yasenh / libtorch-yolov5

A LibTorch inference implementation of the yolov5
MIT License
372 stars 114 forks source link

The models pt to TorchScript what it's unsuccessful #14

Closed molyswu closed 3 years ago

molyswu commented 3 years ago

Hi python models/export.py --weights yolov5s.pt --img 640 --batch 1

Fusing layers... Model Summary: 120 layers, 7.06617e+06 parameters, 7.06617e+06 gradients Traceback (most recent call last): File "models/export.py", line 41, in y = model(img) # dry run

. . .

type(self).name, name)) torch.nn.modules.module.ModuleAttributeError: 'Detect' object has no attribute 'm'

yasenh commented 3 years ago

Hi @molyswu, could to you try to pull the latest updates and re-download the pre-trained model from the yolov5 repo? And make sure your torch version meet the requirement, e.g. v1.6.0 now