Do I need mxnet/op.h if all I need is doing inference by c++ api of mxnet?


#1

I could build mxnet form source if without checking on the option USE_CPP_PACKAGE, after I check it like following graph, compiler always complain when building the examples.

Could I do inference by c++ api without generate that file?

By the way, my building environment:

windows 10 64bits
vc14 64bits
cuda 9.2
cudnn 7.2.1
opencv3.4.2
openBLAS(OpenBLAS-v0.2.14-Win64-int64)

MXNet commit hash:
f387df4cd57b9f05c28c4ebd5c19c0e9ea08ec24


#2

You can turn off examples by -DDO_NOT_BUILD_EXAMPLES=1

You can refer to a complete example here: https://github.com/dmlc/gluon-cv/tree/master/scripts/deployment/cpp-inference


#3

Turn off the example, still the same errors. But at the end I found a way to make it work, the problem is I missed the dll “libgfortran-3.dll”, you can download it from the openBLAS link introduce in the install tutorial page of mxnet. After I download OpenBLAS-v0.2.14-Win64-int64.zip and mingw64_dll.zip, put following dll in the path register in the PATH of win10, op.h is generated.

mkldnn.dll
libgcc_s_seh-1.dll //not sure this one is needed or not
libquadmath-0.dll //not sure this one is needed or not
libgfortran-3.dll
libopenblas.dll
opencv_world342.dll
cublas64_92.dll
cufft64_92.dll
cusolver64_92.dll
curand64_92.dll
nvrtc64_92.dll
nvcuda.dll
mklml.dll    

The examples of the cpp_package can’t build since it need static lib of mxnet, but the default settings of the cmake do not build as static lib.

Hope this post could help another people. Thanks for your link of gluoncv too, I need the example of using c++ api to do the inference tasks.