Image-classification + GPU

Hi,

I’m new to MXNet and I’m trying to run de C++ examples in incubator-mxnet/example/image-classification/predict-cpp directory.

When running without any modification, it works well, I’ve got the following output:
$ ./image-classification-predict ~buildbot/imagenet/ILSVRC2012_img_val/ILSVRC2012_val_00000001.JPEG
model/Inception/Inception-BN-symbol.json … 116922 bytes
model/Inception/Inception-BN-0126.params … 45284780 bytes
[15:21:32] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v0.8.0. Attempting to upgrade…
[15:21:32] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
Can’t open the file. Please check model/Inception/mean_224.nd.
Result data and synset size do not match!
Accuracy[0] = 5.5781882e-08
Accuracy[1] = 2.4132522e-08
Accuracy[2] = 1.3072545e-07

Accuracy[998] = 5.1037706e-08
Accuracy[999] = 5.9475025e-09
Best Result: hartebeest (id=65, accuracy=0.21448761)

After changing the mode from cpu to gpu (dev_type = 2 line 201), I’ve the following error:
make g++ -O3 -c image-classification-predict.cc -std=c++11 -Wno-unknown-pragmas -Wall `pkg-config --cflags opencv` -Wall -I`pwd`/../../../include g++ -O3 -o image-classification-predict image-classification-predict.o `pkg-config --libs opencv` `pwd`/../../../lib/libmxnet.so ./image-classification-predict ~buildbot/imagenet/ILSVRC2012_img_val/ILSVRC2012_val_00000001.JPEG
model/Inception/Inception-BN-symbol.json … 116922 bytes
model/Inception/Inception-BN-0126.params … 45284780 bytes
[15:22:03] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v0.8.0. Attempting to upgrade…
[15:22:03] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
image-classification-predict: image-classification-predict.cc:234: int main(int, char**): Assertion `pred_hnd’ failed.
Aborted (core dumped)

For informatuion, I compiled with
make USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/net/atlas/volume1/shared/opt/nvidia/cuda_9.2-cudnn_7.3/ USE_CUDNN=1 USE_CPP_PACKAGE=1 -j12

Thanks,
Fred

I tried to reproduce your problem, but for me it is working. Can you check your GPU setup? Which GPU does your system have? And on which operating system are you running?

Here are the environment information:
Ubuntu 16.04.5 LTS
$ nvidia-smi
Thu Dec 20 09:38:05 2018
±----------------------------------------------------------------------------+
| NVIDIA-SMI 410.78 Driver Version: 410.78 CUDA Version: 10.0 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX TIT… Off | 00000000:B3:00.0 On | N/A |

Ok it seems that you are using multiple Cuda versions. Your GPU is using version 10.
±----------------------------------------------------------------------------+
| NVIDIA-SMI 410.78 Driver Version: 410.78 CUDA Version: 10.0
|-------------------------------±---------------------±---------------------+
But you installed MXNet with Cuda version 9.2