yolox_s.pth to tensorRT Error
python tools/trt.py -n yolox-s -c preModels/yolox_s.pth
error:
2021-08-26 06:47:14.864 | INFO | __main__:main:52 - loaded checkpoint done.
[TensorRT] INFO: [MemUsageChange] Init CUDA: CPU +300, GPU +0, now: CPU 1889, GPU 970 (MiB)
[TensorRT] WARNING: Tensor DataType is determined at build time for tensors not marked as input or output.
2021-08-26 06:47:21.311 | ERROR | __main__:<module>:77 - An error has been caught in function '<module>', process 'MainProcess' (12166), thread 'MainThread' (140257983133504):
Traceback (most recent call last):
> File "tools/trt.py", line 77, in <module>
main()
└ <function main at 0x7f8f9f310950>
File "tools/trt.py", line 62, in main
max_workspace_size=(1 << 32),
File "/home/moli/anaconda3/envs/tf25/lib/python3.7/site-packages/torch2trt-0.3.0-py3.7.egg/torch2trt/torch2trt.py", line 558, in torch2trt
builder.max_workspace_size = max_workspace_size
│ └ 4294967296
└ <tensorrt.tensorrt.Builder object at 0x7f8f94a50970>
AttributeError: 'tensorrt.tensorrt.Builder' object has no attribute 'max_workspace_size'
The solution to this problem is to reduce the version of NVIDIA tensorrt [2021-8-27]
reference link: https://github.com/NVIDIA-AI-IOT/torch2trt/issues/557
pip install nvidia-tensorrt==7.2.* --index-url https://pypi.ngc.nvidia.com
Finally, with the following command, the model conversion was successful. It took 10 minutes, which was outrageous
python tools/trt.py -n yolox-s -c preModels/yolox_s.pth
`0 N/A N/A 7491 C python 6491MiB `
## output:
cuda : True
2021-08-27 04:09:41.895 | INFO | __main__:main:57 - loaded checkpoint done.
[TensorRT] WARNING: Tensor DataType is determined at build time for tensors not marked as input or output.
[TensorRT] INFO: Some tactics do not have sufficient workspace memory to run. Increasing workspace size may increase performance, please check verbose output.
[TensorRT] INFO: Detected 1 inputs and 1 output network tensors.
2021-08-27 04:17:33.106 | INFO | __main__:main:70 - Converted TensorRT model done.
2021-08-27 04:17:33.286 | INFO | __main__:main:78 - Converted TensorRT model engine file is saved for C++ inference.
Conversion model default path: yolox_ outputs/yolox_ s/
ll YOLOX_outputs/yolox_s/
total 52348
22065949 Aug 27 04:17 model_trt.engine
31524975 Aug 27 04:17 model_trt.pth
Read More:
- Onnx to tensorrt model error [How to Solve]
- TensorRT model quantization error: Error Code 1: Cuda Runtime (an illegal memory access was encountered)
- [Solved] AttributeError: ‘openvino.inference_engine.ie_api.IENetwork‘ object has no attribute ‘input_info‘
- PySpark error: AttributeError: ‘NoneType‘ object has no attribute ‘_jvm‘
- [Solved] redis Error: AttributeError: ‘list‘ object has no attribute ‘decode‘
- ROS package executes rosrun error: attributeerror: ‘thread’ object has no attribute ‘isalive‘
- [Solved] AttributeError: ‘depthai.node.ObjectTracker‘ object has no attribute ‘setTrackerIdAssigmentPolicy‘
- Pyqt5 Error: AttributeError: ‘QWidget‘ object has no attribute ‘setCentralWidget‘
- [Solved] AttributeError : ‘GridSearchCV‘ object has no attribute ‘grid_scores_‘
- [Solved] AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
- Numpy.exp Function Error ‘Float’ object has no attribute ‘exp’
- [Jeston Xavier NX Compile librealsense Error] AttributeError: module ‘pyrealsense2‘ has no attribute ‘pipeline‘
- [Solved] OpenCV Error: AttributeError: module ‘cv2‘ has no attribute ‘data‘
- [Solved] AttributeError: module ‘keras.preprocessing.image‘ has no attribute ‘load_img‘
- Attributeerror encountered when using ceilometer and gnocchi to execute commands related to gnocchi metric list: _Environ instance has no attribute ‘
- Peewee insert data error:’buffer’ object has no attribute’translate’
- TensorFlow error: AttributeError: module ‘tensorflow_core._api.v2.train’ has no attribute ‘Optimizer‘
- [Solved] Raspberry Pi Error: AttributeError: module ‘serial‘ has no attribute ‘Serial‘
- Pytorch error: `module ‘torch‘ has no attribute ‘__version___‘`
- Tensorflow error: InvalidArgumentError: indices[data_index] = data_value is not in [0, max_embedding_size)