Errors with running the demo of the Classic Image Segmentation

it look like a dimension problem. Is your image single channel or multilple channel? 2d or 3d?

or you can simply try IMG.shape, which will tell the size of your image.

Jianxu