Hi,
I’m encountering an issue when exporting a YOLOv8 model to ONNX using PyTorch 1.14, but when I run the model through TensorRT, the logs indicate that it’s using PyTorch 2.0.0 as the producer version. Here are the details:
-
Export Process:
- I used PyTorch version 1.14 for exporting the model to ONNX:
torch.onnx.export(model, dummy_input, "yolov8s.onnx", opset_version=11)
- The ONNX export completed without errors, and the model file
yolov8s.onnx
was generated successfully.
- I used PyTorch version 1.14 for exporting the model to ONNX:
-
TensorRT Conversion:
- When I use TensorRT’s
trtexec
to convert the ONNX model, I notice that the logs show that the model’s producer is listed as PyTorch 2.0.0:[12/06/2024-12:32:39] [I] [TRT] Producer name: pytorch [12/06/2024-12:32:39] [I] [TRT] Producer version: 2.0.0
- The export was done with PyTorch 1.14, not 2.0.0.
- When I use TensorRT’s
-
Expected Behavior:
- I expected the producer version to show 1.14, consistent with the PyTorch version used during export.
-
What I’ve Tried:
- I’ve double-checked my PyTorch version with
torch.__version__
and confirmed it’s 1.14. - I’ve tried re-exporting the model and rebuilding the environment but still get the same result.
- I’ve double-checked my PyTorch version with
-
Environment:
- PyTorch version: 1.14
- TensorRT version: 8.5.2
- CUDA version: 11.4
Has anyone encountered this issue before? Any suggestions on how to resolve this discrepancy?
Thanks!