-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while running live_demo.ipynb, __len__() should return >= 0 #178
Comments
Have you found a solution? |
@Po-Ting-lin I read your log thoroughly and it seems to me that we have the exact same setup, and also the same type of error. The only difference was that I got stuck with the trt_pose_hand project, which is a derivative of the trt_pose. What fixe the issue for me was that I went through initial dependencies setup again while putting more attention to download correct and not mix up the version of packages. This is the procedure that I have followed, after which I was able to run the notebook. Setup
Which fixed the issue for me. At least I can tell that the code is working and maybe give you a little clue that the source of the problem might be in the environment variables or packages that are installed, not the code of the script itself. |
Thanks, @jiri-kula! I encountered the same issue, but I managed to resolve it after seeing your explanation. The issue occurs because torch2trt does not support PyTorch 2.x versions. Since I’m using PyTorch 2.x, that’s why the problem arose. Some suggest downgrading to PyTorch 1.x to resolve the issue, but I’m unable to do that since I’m working on another project that requires PyTorch 2.x. So, instead of using torch2trt, I converted the model directly into a TensorRT engine. I hope this solution can help others who are facing similar issues. This is the code I used: print('-----------------------Model Load Part------------------') WIDTH=224 data=torch.zeros((1,3, HEIGHT, WIDTH)).cuda() torch.onnx.export( TRT_LOGGER = trt.Logger(trt.Logger.WARNING) parser = trt.OnnxParser(network, TRT_LOGGER) with open("trt-pose.onnx",'rb') as mf: config = builder.create_builder_config() if builder.platform_has_fast_fp16: profile = builder.create_optimization_profile() |
Hi Guys,
I tried to run this repo on Jetson nano, and I did the same steps in the instruction.
Somehow it failed to convert model to TRT.
It seems the dimension is not correct?
Is anyone know why, Thanks!
The text was updated successfully, but these errors were encountered: