I encountered the following error when using yolov5 on nx, how to solve it?

My steps are as follows:

  1. generate .wts from pytorch with .pt, or download .wts from model zoo
// clone code according to above #Different versions of yolov5
// download https://github.com/ultralytics/yolov5/releases/download/v6.0/yolov5s.pt
cp {tensorrtx}/yolov5/gen_wts.py {ultralytics}/yolov5
cd {ultralytics}/yolov5
python gen_wts.py -w yolov5s.pt -o yolov5s.wts
// a file 'yolov5s.wts' will be generated.
  1. build tensorrtx/yolov5 and run
cd {tensorrtx}/yolov5/
// update CLASS_NUM in yololayer.h if your model is trained on custom dataset
mkdir build
cd build
cp {ultralytics}/yolov5/yolov5s.wts {tensorrtx}/yolov5/build
cmake ..
sudo ./yolov5 -s [.wts] [.engine] [n/s/m/l/x/n6/s6/m6/l6/x6 or c/c6 gd gw]  // serialize model to plan file
sudo ./yolov5 -d [.engine] [image folder]  // deserialize and run inference, the images in [image folder] will be processed.
// For example yolov5s
sudo ./yolov5 -s yolov5s.wts yolov5s.engine s

The error result is as follows:
CUDA error 1 at /home/nvidia/tensorrtx/yolov5/yololayer.cu:52yolov5: /home/nvidia/tensorrtx/yolov5/yololayer.cu:52: virtual nvinfer1::YoloLayerPlugin::~YoloLayerPlugin(): Assertion `0’ failed.

Please continue updating t How to solve the following error when using nx to configure yolov5 - Jetson & Embedded Systems / Jetson AGX Xavier - NVIDIA Developer Forums

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.