Strange expect NDArray error for ssd.transform_test

Hi there, I’m trying to use the gluon SSD detection model however I am getting an error while running:

x, img = data.transforms.presets.ssd.transform_test(image, short=short, max_size=max_size)

AssertionError: Expect NDArray, got <class 'mxnet.ndarray.ndarray.NDArray'>

I have converted my numpy array to ndarray using mx.nd.array(image).
Any thoughts on how to get around this?

Thanks, Dave

Hi, I have the same problem.
My ‘image’ was created using
camera = cv2.VideoCapture(0); return_value, img =
Have you moved further with this issue?

1 Like

Sorry I haven’t unfortunately. Really hoping some one can jump in w. a solution :slight_smile:

1 Like

Open ‘site-packages/gluoncv/data/transforms/presets/’ file, so if your gluoncv is latest, you will see the code as below in ‘transform_test’ method.

if isinstance(imgs, mx.nd.NDArray):
    imgs = [imgs]
for im in imgs:
    assert isinstance(im, mx.nd.NDArray), "Expect NDArray, got {}".format(type(im))

Check these commands: ‘isinstance((your array), mx.nd.NDArray)’ and ‘type((your array))’
If you get ‘false’ and ‘mxnet.ndarray.ndarray.NDArray’, I think it is a bug.