You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TensorRT: starting export with TensorRT 8.0.1.6...
TensorRT: export failure: export running on CPU but must be on GPU, i.e. python export.py --device 0
Traceback (most recent call last):
File "export.py", line 526, in
main(opt)
File "export.py", line 521, in main
run(**vars(opt))
File "/home/.local/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
return func(*args, **kwargs)
File "export.py", line 479, in run
LOGGER.info(f'\nExport complete ({time.time() - t:.2f}s)'
IndexError: list index out of range
Seems that the PyTorch 1.7.0 version is a little outdated, it is better to upgrade the current PyTorch version to 1.9+ or use the intermediate exported ONNX model to convert to the TensorRT engine.
@ONNONS good news 😃! We've improved ✅ error handling for zero-export cases in PR #6569. You should now see a clearer error message on export failure, i.e.:
To receive this update:
Git – git pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
Docker – sudo docker pull ultralytics/yolov5:latest to update your image
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!
What version should I use? Pytorch , cuda, tensorrt, torchvision . . . Etc
Hi @ONNONS , The minimum version requirements for PyTorch and torchvision should be 1.8 and 0.9, check out the official guide to install them on your CUDA device https://pytorch.org/get-started/locally/
For myself, I suggest to install the latest version of TensorRT (8.2.x), the new version of TensorRT will give you a completely different user experience.
Activity
zhiqwang commentedon Feb 8, 2022
Seems that the PyTorch 1.7.0 version is a little outdated, it is better to upgrade the current PyTorch version to 1.9+ or use the intermediate exported ONNX model to convert to the TensorRT engine.
glenn-jocher commentedon Feb 8, 2022
@ONNONS error message you showed is self explanatory:
Fix zero-export handling with `if any(f):`
Fix zero-export handling with `if any(f):` (#6569)
glenn-jocher commentedon Feb 8, 2022
@ONNONS good news 😃! We've improved ✅ error handling for zero-export cases in PR #6569. You should now see a clearer error message on export failure, i.e.:
To receive this update:
git pullfrom within youryolov5/directory orgit clone https://github.com/ultralytics/yolov5againmodel = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)sudo docker pull ultralytics/yolov5:latestto update your imageThank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!
njustczr commentedon Feb 11, 2022
on jetson nano,

so i can not export *.pt file to *.engine file
zhiqwang commentedon Feb 11, 2022
YOLOv5's default TensorRT inference relies on the CUDA version of PyTorch:
yolov5/models/common.py
Line 418 in cb2ad9f
I guess that you can replace the data binding here to
pycudato reduce this dependency.ONNONS commentedon Feb 11, 2022
What version should I use? Pytorch , cuda, tensorrt, torchvision . . . Etc
zhiqwang commentedon Feb 12, 2022
Hi @ONNONS , The minimum version requirements for PyTorch and torchvision should be 1.8 and 0.9, check out the official guide to install them on your CUDA device https://pytorch.org/get-started/locally/
For myself, I suggest to install the latest version of TensorRT (8.2.x), the new version of TensorRT will give you a completely different user experience.
Update Neuralmagic-YoloV5 integration to v6.1 (#29)
Fix zero-export handling with `if any(f):` (ultralytics#6569)
Fix zero-export handling with `if any(f):` (#6569)
Fix zero-export handling with `if any(f):` (#6569)