yolov5-onnx-tensorrt icon indicating copy to clipboard operation
yolov5-onnx-tensorrt copied to clipboard

can't convert to onnx file

Open TaucherLoong opened this issue 2 years ago • 0 comments

python yolov5_onnx.py -w last.pt -is 640 -bs 4 Namespace(batch_size=4, img_size=[640, 640], weights='last.pt') torch.Size([4, 3, 640, 640]) Traceback (most recent call last): File "yolov5_onnx.py", line 33, in model = attempt_load(opt.weights, map_location=torch.device('cpu')) # load FP32 model File "/home/taucher/workspace/yolov5-onnx-tensorrt/networks/experimental.py", line 144, in attempt_load model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval()) # load FP32 model File "/home/taucher/.virtualenvs/yolov5/lib/python3.6/site-packages/torch/serialization.py", line 607, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/taucher/.virtualenvs/yolov5/lib/python3.6/site-packages/torch/serialization.py", line 882, in _load result = unpickler.load() File "/home/taucher/.virtualenvs/yolov5/lib/python3.6/site-packages/torch/serialization.py", line 875, in find_class return super().find_class(mod_name, name) ModuleNotFoundError: No module named 'models'

TaucherLoong avatar Dec 30 '21 06:12 TaucherLoong