MXNetError: ImageRec need opencv to process

I’m trying to train the MXNet resnet-50 model from the finetune notebook (Fine-tune with Pretrained Models — mxnet documentation)

and I keep encountering the following error on my Jetson Xavier NX:

MXNetError: Traceback (most recent call last):
File “/home/nvidia/mxnet/mxnet/src/io/iter_image_recordio_2.cc”, line 260
MXNetError: ImageRec need opencv to process

It seems to not have access to opencv even though I have Opencv4.5 installed. I’ve tried re-installing mxnet 1.7 several times (following the instructions from Jetson zoo) with no luck getting this to work.

I even tried modifying the autoinstall_mxnet.sh file prior to install by changing the line
"sudo make -j$(nproc) install && "
with
"sudo make -j$(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 install && "

That didn’t seem to work. Any ideas what is wrong?

Hi,

The package doesn’t build with OpenCV support.
Could you turn it on and build it from source?

Thanks.

I built mxnet from source using the above autobuild_mxnet.sh script but its giving me an error when I try to use it on the command prompt:

Any ideas?

Hi,

Which branch do you build from.
It seems that ndarray class occurs from branch 1.6.x.
https://github.com/apache/incubator-mxnet/blob/v1.6.x/python/mxnet/init.py#L33

Thanks.

From JEP/autobuild_mxnet.sh at master · AastaNV/JEP · GitHub
script, I built using
git clone https://github.com/apache/incubator-mxnet.git --branch v1.7.x --recursive mxnet

So its mxnet v1.7.x. Are you saying that v1.7.x won’t work for the autobuild_mxnet.sh install? I ask because it seemed to work fine with the autoinstall_mxnet.sh install.

Hi,

The class exists in branch 1.6.x or newer.
So it should be included in v1.7.x also.

We are going to check this issue internally.
Will update more information later.

Thanks.

Ok I’ll try again with v1.7x. Should I use the autobuild_mxnet.sh script? Please let me know. I really trying to get this working. Thanks.