Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

求助 How to export .pth files in model_zoo to onnx files? #572

Open
carrieyummy opened this issue Jan 26, 2024 · 0 comments
Open

求助 How to export .pth files in model_zoo to onnx files? #572

carrieyummy opened this issue Jan 26, 2024 · 0 comments

Comments

@carrieyummy
Copy link

carrieyummy commented Jan 26, 2024

link: https://kaiyangzhou.github.io/deep-person-reid/MODEL_ZOO
I used the pth files below title "ImageNet pretrained models"
I have tried some commands like these below but not suceesed at all
And how to know the imgsz? 脚本的--imgsz 参数是根据什么指定?初学者不太明白 求教谢谢

(torchreid) azurengine@azurengine-System-Product-Name:~/workspace/deep-person-reid-master/tools$ python export.py --weights /home/azurengine/workspace/ImageNetPreTrainedModels/osnet_x0_25_imagenet.pth --include onnx --imgsz 1 3 256 128

Model: osnet_x0_25

  • params: 203,568
  • flops: 82,316,000
    Successfully loaded pretrained weights from "/home/azurengine/workspace/ImageNetPreTrainedModels/osnet_x0_25_imagenet.pth"
    ** The following layers are discarded due to unmatched keys or layer size: ['classifier.weight', 'classifier.bias']
    export failure: invalid syntax (init.py, line 176)
    Traceback (most recent call last):
    File "export.py", line 200, in
    f = export_onnx(extractor.model.eval(), im, args.weights, 12, train=False, dynamic=args.dynamic, simplify=True) # opset 12
    File "export.py", line 98, in export_onnx
    return f
@carrieyummy carrieyummy changed the title 求助 How to export pth files in model_zoo to onnx files? 求助 How to export .pth files in model_zoo to onnx files? Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant