jason-li-831202 / Vehicle-CV-ADAS

The project can achieve FCWS, LDWS, and LKAS functions solely using only visual sensors. using YOLOv5 / YOLOv5-lite / YOLOv6 / YOLOv7 / YOLOv8 / YOLOv9 / EfficientDet and Ultra-Fast-Lane-Detection-v2 .
GNU General Public License v3.0
162 stars 38 forks source link

convertPytorchToONNX.py #4

Closed Minnchong closed 2 months ago

Minnchong commented 1 year ago

I successfully converted the curvelanes/tusimple.pth into curvelanes/tusimple.onnx. When I try to achieve culane.onnx, the process was killed at torch.onnx.export(net, img, onnx_file_path, verbose=True).

jason-li-831202 commented 1 year ago

I haven't encountered this issue before, could you provide me with the error traceback? Also, if you want better performance, I suggest using the ultra-fast lane detection v2 version would be better.

Jilin-Cancer commented 9 months ago

I also encountered a similar problem where the operation was terminated abnormally

C:\Users\86152\anaconda3\envs\lane-det\python.exe C:/Users/86152/Desktop/AI/code/Vehicle-CV-ADAS-master/TrafficLaneDetector/convertPytorchToONNX.py Model Type : UFLDV2_TUSIMPLE C:\Users\86152\anaconda3\envs\lane-det\lib\site-packages\torchvision\models_utils.py:209: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead. f"The parameter '{pretrained_param}' is deprecated since 0.13 and may be removed in the future, " C:\Users\86152\anaconda3\envs\lane-det\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=ResNet18_Weights.IMAGENET1K_V1. You can also use weights=ResNet18_Weights.DEFAULT to get the most up-to-date weights. warnings.warn(msg)

Process finished with exit code -1073741819 (0xC0000005)

jason-li-831202 commented 9 months ago

In torchvision 0.13, there were updates to the pre-trained model loading. I believe there might be compatibility issues with the provided .pth files by the original author.

you can download the onnx model using the following script: https://github.com/PINTO0309/PINTO_model_zoo/blob/main/324_Ultra-Fast-Lane-Detection-v2/download.sh.