NVIDIA-AI-IOT / tf_to_trt_image_classification

Image classification with NVIDIA TensorRT from TensorFlow models.
BSD 3-Clause "New" or "Revised" License
456 stars 155 forks source link

OSError while running convert_plan.py #29

Closed raghavgurbaxani closed 6 years ago

raghavgurbaxani commented 6 years ago

Hi

while running python scripts/convert_plan.py data/frozen_graphs/inception_v1.pb data/plans/inception_v1.plan input 224 224 InceptionV1/Logits/SpatialSqueeze 1 0 float

after following the instructions, I get the following error -

Using output node InceptionV1/Logits/SpatialSqueeze Converting to UFF graph No. nodes: 486 UFF Output written to data/tmp.uff Traceback (most recent call last): File "scripts/convert_plan.py", line 71, in data_type File "scripts/convert_plan.py", line 37, in frozenToPlan subprocess.call([UFF_TO_PLAN_EXE_PATH] + args) File "/usr/lib/python2.7/subprocess.py", line 523, in call return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py", line 711, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

Any idea whats wrong ?

Using TensorRT 3.0

ghost commented 6 years ago

It seems like it's failing when calling the C++ executable uff_to_plan. Did you build the project as in the setup instructions?

raghavgurbaxani commented 6 years ago

I had issues with the 'make' command since I am doing my experiments on the Volta V100, instead of the TX2.

Any suggestions ?

ghost commented 6 years ago

Ah, you'll need to make sure that make succeeds.

What error do you see when trying to build for V100?

raghavgurbaxani commented 6 years ago

during 'make', i get the following error on V100

$ make [ 33%] Built target classify_image [ 50%] Building CXX object src/CMakeFiles/uff_to_plan.dir/uff_to_plan.cpp.o /mnt/fifth/tf_to_trt_image_classification/src/uff_to_plan.cpp: In function ‘int main(int, char)’: /mnt/fifth/tf_to_trt_image_classification/src/uff_to_plan.cpp:71:79: error: no matching function for call to ‘nvuffparser::IUffParser::registerInput(const char, nvinfer1::DimsCHW)’ parser->registerInput(inputName.c_str(), DimsCHW(3, inputHeight, inputWidth)); ^ In file included from /mnt/fifth/tf_to_trt_image_classification/src/uff_to_plan.cpp:12:0: /usr/include/x86_64-linux-gnu/NvUffParser.h:182:18: note: candidate: virtual bool nvuffparser::IUffParser::registerInput(const char, nvinfer1::Dims, nvuffparser::UffInputOrder) virtual bool registerInput(const char inputName, nvinfer1::Dims inputDims, UffInputOrder inputOrder) = 0; ^ /usr/include/x86_64-linux-gnu/NvUffParser.h:182:18: note: candidate expects 3 arguments, 2 provided src/CMakeFiles/uff_to_plan.dir/build.make:62: recipe for target 'src/CMakeFiles/uff_to_plan.dir/uff_to_plan.cpp.o' failed make[2]: [src/CMakeFiles/uff_to_plan.dir/uff_to_plan.cpp.o] Error 1 CMakeFiles/Makefile2:160: recipe for target 'src/CMakeFiles/uff_to_plan.dir/all' failed make[1]: [src/CMakeFiles/uff_to_plan.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: [all] Error 2

and for 'convert_plan.py', I get the OS error.

ghost commented 6 years ago

This looks like an API discrepancy between TRT 3 / TRT 4+. If so, the branch trt_4plus has the fix for this.

You can call

dpkg -l | grep tensorrt

To see the install TensorRT version. To get the fix, simply call

git checkout trt_4plus

From inside the project.

raghavgurbaxani commented 6 years ago

thank you very much, it worked. 👍