Closed FeriBolour closed 2 years ago
I am running into a similar issue. Have you managed to solve it by any chance?
Same here
Was not obvious to figure out but in my case I was able to run the conversion by making the width and height divisible by 64 rather than 32 as state in the README.
"1344 instead of 1333 because model requires both height and width of the input tensor to be divisible by 32"
I tried that too- it didn't work-edit: It also said in some of the demos that It had to be divisible by 32- and again - 1344 is divisible by 64 aswell as required.
@sph1n3x @frankvp11 @bceulema In my case I just forgot to modify export_model.py as mentioned in the documents.
After that it works. I believe if you follow everything exactly the way it says it will work.
I was even able to create a TensorRT engine for my custom 4 category model.
Hey @frankvp11 , Correct me if I am mistaken but I think on another issue I saw that you managed to instal tensorRT 8.4.2 on a Jetson TX2 with Ubuntu 18.04.
If that's correct, can I ask how did you manage to do that as my understanding was that you can't upgrade TensorRT without SDKManager.
Thank You
Yup- I realize now that I didn't actually have TensorRT 8.4.2 on the Jetson. What i did have however, was the libraries necessary. There is a way of installing them, ill send you the links later when Im at work
On Tue, Aug 23, 2022 at 3:27 AM FeriBolour @.***> wrote:
Hey @frankvp11 https://github.com/frankvp11 , Correct if I am mistaken but I think on another issue I saw that you managed to instal tensorRT 8.4.2 on a Jetson TX2 with Ubuntu 18.04.
If that's correct, can I ask how did you manage to do that as my understanding was that you can't upgrade TensorRT without SDKManager.
Thank You
— Reply to this email directly, view it on GitHub https://github.com/NVIDIA/TensorRT/issues/2192#issuecomment-1223663685, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVPPUJRLCEOVJZY7VLCXRCDV2R4PPANCNFSM55CTSLHQ . You are receiving this because you were mentioned.Message ID: @.***>
So the way I got it working was as follows - follow the instructions at :+1: https://github.com/NVIDIA-AI-IOT/deepstream_tao_apps/tree/master/TRT-OSS/Jetson
@frankvp11 thank you so much. This can help me immensely if it works on my jetson agx. As I need to keep my OS in ubuntu 18.04 and not upgrade to jetpack 5.0.2.
I'll give it a try. Thank You
@frankvp11 Hey I am following the instructions in the link above and I generated libnvinfer_plugin.so.8.4.1 file for TensorRT 8.4.1.
and I copied it into the directory /usr/lib/aarch64-linux-gnu/
as the instructions says.
However if I want to use tensorRT in a python file like infer.py
my TensorRT library version still says 8.2.1.
Is there some extra steps that I have to do.
I would appreciate your help.
Thank You
Yeah it still uses TensorRT 8.2.1, but now it uses the plugins from (I used the most recent TensorRT). aka 8.4.3 and it works for me. So basically what you'd have to do is take the converted onnx from the primary onnx converter in the samples/detectron2. I believe it was called create_onnx.py. You take that onnx and then build the engine on the host. This will give you the updated ops and will work with infer.py. You can (from my understanding of TX2) safely ignore the fact that it says 8.2.1. Or atleast thats how it works for me. I am currently trying to repro this in a dockerfile.
Hello @frankvp11 Could you please explain how did you manage to use TensorRT 8.4.3 on your board, we only have TensorRT 8.2.1
Hi Hannah, If I remember correctly I had that exact problem as well. Again, if I remember correctly there was a file with some tensorrt settings that I had to change and the Sudo apt update. I don't remember if I ever got a dockerfile working if that is the approach you are looking to take. I looked back and found the file I needed to change. What you need to change in the file if I remember correctly is update the version to 8.4.3 (it will be obvious if you open the file). If this doesn't work, I published an article which might be of more help. https://medium.com/@frankvanpaassen3/how-to-optimize-custom-detectron2-models-with-tensorrt-2cd710954ad3
sudo gedit /etc/apt/sources.list.d/nvidia-l4t-apt-source.list sudo apt-get update sudo apt-get dist-upgrade (type y when needed) sudo apt-get update
These were the instructions that I had written down when I worked for the company when I had to do this.
Forgot to mention but the file you needed to edit was the /etc/apt/sources.list.d/nvidia-l4t-apt-sourxlce.list if it wasn't obvious
Again, forgot to mention but you could try using the instructions as outlined here: https://github.com/NVIDIA-AI-IOT/deepstream_tao_apps/tree/master/TRT-OSS/Jetson
Thank you @frankvp11 for your quick response, I'll try your suggestion and see what can I get. My sincere thanks.
Hey Hannah, just wanted to follow up. Did you end up getting the install working?
Hello @frankvp11
thank you for your consideration, unfortunately not yet
I ran into this error:
Building for TensorRT version: 8.5.3, library version: 8
-- The CXX compiler identification is GNU 7.5.0
-- The CUDA compiler identification is unknown
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:48 (project):
No CMAKE_CUDA_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred! See also "/home/nvidia/TensorRT/build/CMakeFiles/CMakeOutput.log". See also "/home/nvidia/TensorRT/build/CMakeFiles/CMakeError.log".
I got this error after typing this command $HOME/install/bin/cmake .. -DGPU_ARCHS=”53 62 72" -DTRT_LIB_DIR=/usr/lib/aarch64-linux-gnu/ -DCMAKE_C_COMPILER=/usr/bin/gcc -DTRT_BIN_DIR=pwd
/out
I changed the architecture version and cuda version as outlined your article
I remember that bug aswell. (I don't know where/how you find the following information but) check your g++ version against the required by tensorrt. It also might be wise to check the command you are using because I don't remember that for my working version I had to list GPU archs and whatnot. I believe I also noted in the article to check nvcc -v to make sure that works as well. I'd say try that, and if all else fails I'll look back into my old forum posts to see if there is any help there
thank you again, I am working on it, I will get back to you soon with further updates.
Hi I get rid of that error by adding this line SET(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc) to CMakelists.txt but I got other error
Description
Hello Everyone,
I was trying to exactly follow the steps of converting Detectron2 MaskRCNN R50-FPN 3x to TensorRT mentioned at https://github.com/NVIDIA/TensorRT/tree/main/samples/python/detectron2. I even used the same .pkl model --> _model_finalf10217.pkl from https://github.com/facebookresearch/detectron2/blob/main/MODEL_ZOO.md
However in the last step when running
python3 build_engine.py --onnx 'converted.onnx' --engine 'TensorRT_fp16.trt' -c 'detectron2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml' -p fp16
I get the following error:I don't really know why this is happening since I am trying to exactly following the steps as instructed. Could anyone please help me with this issue?
Thank You
Environment
TensorRT Version: 8.4.2-1+cuda11.6 NVIDIA GPU: TITAN RTX NVIDIA Driver Version: 510.39.01 CUDA Version: 11.6 CUDNN Version: 8 Operating System: Ubuntu 20.04 Python Version: Python 3.8.10 Tensorflow Version: 2.7 PyTorch Version: Tried with both 1.9.0+cu111 and 1.10.1+cu111 Detectron2 Version: 0.6
Relevant Files
Please copy the links below and paste them in a new tab. For some reason, they don't open correctly when you just click on them.
Here's the link for the model from the command below: https://drive.google.com/file/d/1e7wqMtqkAXp1Ilw8EC79GAsCVgEt8GcJ/view?usp=sharing
Here's the link for the model from the command below: https://drive.google.com/file/d/1nCAz73kPwOwfn9jIv4Z2earCrqCrm9Oq/view?usp=sharing
Here's the link for the image used in the above commands: https://drive.google.com/file/d/1PYLMY96FmG41TcllV7ZMSC739cGsTRnv/view?usp=sharing
Console Output From Other Commands
when I run
python3 detectron2/tools/deploy/export_model.py
I get the following output:When I run
python3 create_onnx.py
I get the following output: