mailrocketsystems / JetsonYolov5

GNU General Public License v3.0
24 stars 25 forks source link

Segmentation fault while generating the WTS file #4

Open OUTLAOUAIT opened 1 year ago

OUTLAOUAIT commented 1 year ago

I get a Segmentation fault (core dumped) while generating the WTS file. python3 gen_wts.py -w yolov5s.pt -o yolov5s.wts

Kr-Sheshank commented 10 months ago

I was trying to convert the custom trained model into wts file but it is not working. using the below command
python3 gen_wts.py -w yolov5s.pt -o yolov5s.wts It is showing following error

Traceback (most recent call last): File "gen_wts.py", line 43, in delattr(model.model[-1], 'anchor_grid') # model.model[-1] is detect layer File "/home/cnhi/models/TRT/TRT_env_2/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1685, in delattr super().delattr(name) AttributeError: anchor_grid

If we comment out the line it shows the next error delattr(model.model[-1], 'anchor_grid') # model.model[-1] is detect layer Traceback (most recent call last): File "gen_wts.py", line 46, in model.model[-1].register_buffer("strides", model.model[-1].stride) File "/home/cnhi/models/TRT/TRT_env_2/lib/python3.8/site-packages/torch/nn/modules/module.py", line 523, in register_buffer raise KeyError("attribute '{}' already exists".format(name)) KeyError: "attribute 'strides' already exists"

If comment this line also it is generating wts file but while converting wts to engine it is showing error missing strides

But when I tried to converted the pretrained coco yolov5n model it get converted into wts and in engine and working fine.

m4rsquake commented 8 months ago

@OUTLAOUAIT for this issue: export OPENBLAS_CORETYPE=ARMV8 python in your terminal for temporary use or vim ~/.bashrc add this to the bottom of the file export OPENBLAS_CORETYPE=ARMV8 to take effect: source ~/.bashrc hopes this help.