NVIDIA-AI-IOT / scene-text-recognition

Other
36 stars 14 forks source link

Error when try to setup scene-text-recongnition (step 3, torch2trt) #5

Closed yoli1888 closed 2 years ago

yoli1888 commented 2 years ago

Following instructions to setup scene-text-recognition on macbook. Able to complete step 1 and step 2. In step 3, encounter following error: Traceback (most recent call last): File "scene-text-recognition/torch2trt_orig/setup.py", line 15, in <module> plugins_ext_module = CUDAExtension( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 912, in CUDAExtension library_dirs += library_paths(cuda=True) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1020, in library_paths if (not os.path.exists(_join_cuda_home(lib_dir)) and File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 2035, in _join_cuda_home raise EnvironmentError('CUDA_HOME environment variable is not set. ' OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

I try to replace the torch2trt directory with GitHub https://github.com/NVIDIA-AI-IOT/torch2trt. Encounter following error:

Traceback (most recent call last): File "scene-text-recognition/torch2trt/setup.py", line 2, in import tensorrt ModuleNotFoundError: No module named 'tensorrt'

I do have tensorrt installed:

pip3 list | grep ten tensorboard 2.6.0 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.0 tensorflow 2.6.2 tensorflow-addons 0.15.0 tensorflow-estimator 2.6.0 tensorflow-io-gcs-filesystem 0.22.0 tensorrt 0.0.1

Could you suggest any workaround or packages I should install in order to proceed?

yoli1888 commented 2 years ago

It is the following steps giving me the above error.

cd torch2trt sudo python3 setup.py install --plugins

akamboj2 commented 2 years ago

how did you set up tensorrt? I installed with pip Wheel here: https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-pip and mine pip list is showing:

nvidia-tensorrt 8.2.3.0

Also have you tried without the sudo: python3 setup.py install --plugins

taking out the sudo is getting rid of that error for me. I suspect it might be because i'm in a conda environment, but i'm not sure.

yoli1888 commented 2 years ago

I am having the following error when I try the 'python3 setup.py install --plugins':

In file included from torch2trt/plugins/plugins.cpp:2: torch2trt/plugins/interpolate.cpp:6:10: fatal error: NvInfer.h: No such file or directory 6 | #include | ^~~ compilation terminated.

What other packages I am missing?

yoli1888 commented 2 years ago

I found the work around from https://github.com/NVIDIA-AI-IOT/torch2trt/issues/409