yolov5部署

https://www.rs-online.com/designspark/nvidia-cudagpujetson-nano-tensorrt-2-cn
yolov5部署_第1张图片

https://github.com/wang-xinyu/tensorrtx/tree/yolov5-v5.0/yolov5

For yolov5 v5.0, download .pt from yolov5 release v5.0, git clone -b v5.0 https://github.com/ultralytics/yolov5.git and git clone -b yolov5-v5.0 https://github.com/wang-xinyu/tensorrtx.git, then follow how-to-run in tensorrtx/yolov5-v5.0.
python gen_wts.py -w weights/yolov5s.pt -o yolov5s.wts

https://github.com/wang-xinyu/tensorrtx/tree/yolov5-v5.0/yolov5
v5和转换的对应

报错

python gen_wts.py
Traceback (most recent call last):
File “gen_wts.py”, line 6, in
from utils.torch_utils import select_device
ModuleNotFoundError: No module named ‘utils’

from utils.torch_utils import select_device
ModuleNotFoundError: No module named ‘utils.torch_utils’

环境的问题
解决办
https://www.i4k.xyz/article/qq_42362891/116107108

 [E] [TRT] Parameter check failed at: ../builder/Network.cpp::addScale::482, condition: shift.count > 0 ? (shift.values != nullptr) : (shift.values == nullptr)
yolov5: /home/ll/Documents/20220111_yolov5/tensorrtx/yolov5/common.hpp:155: nvinfer1::IScaleLayer* addBatchNorm2d(nvinfer1::INetworkDefinition*, std::map<std::__cxx11::basic_string<char>, nvinfer1::Weights>&, nvinfer1::ITensor&, std::__cxx11::string, float): Assertion `scale_1' failed.
Aborted

是因为不是拷贝过去的tensorx而是从新下载的才报错的。

ll@ll:~/Documents/20220111_yolov5/tensorrtx/yolov5/build$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_21:14:42_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89

lov5s.engine …/samples
98ms
42ms
36ms
36ms
37ms
32ms
31ms
33ms
24ms
24ms
27ms
29ms
24ms
25ms
24ms
23ms
24ms
22ms
23ms
23ms
22ms
22ms
23ms
22ms
22ms
22ms
23ms
22ms
26ms
22ms
23ms
28ms
22ms
22ms
22ms
22ms
25ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
24ms
22ms
25ms
29ms
23ms
22ms
23ms
25ms
22ms
22ms
22ms
22ms
22ms
23ms
22ms
23ms
28ms
23ms
23ms
22ms
22ms
22ms
22ms
25ms
24ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
23ms
26ms
23ms
22ms
23ms
25ms
22ms
22ms
22ms
22ms
23ms
22ms
23ms
22ms
22ms
22ms
22ms
26ms
22ms
29ms
27ms
22ms
22ms
24ms
25ms
23ms
22ms
22ms
22ms
22ms
23ms
22ms
22ms
22ms
22ms
23ms
23ms
22ms
24ms
23ms
23ms
24ms
24ms
23ms
22ms
24ms
24ms
22ms
23ms
22ms
22ms
22ms
22ms
22ms
23ms
22ms
22ms
22ms
22ms
22ms
22ms
23ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
23ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
23ms
22ms
22ms
22ms
22ms
22ms
22ms
23ms
24ms
24ms
24ms
24ms
24ms
22ms
22ms
22ms
22ms
22ms
22ms
22ms
23ms
23ms
22ms
22ms
22ms
22ms
22ms
22ms
23ms
22ms
22ms
22ms

你可能感兴趣的:(pytorch,深度学习,python)