Skip to content

converting .pt to onnx with dynamic flag #8377

@git-hamza

Description

@git-hamza

Search before asking

Question

I am trying to convert .pt model to onnx, it successfully gets converted to onnx without the --dynamic flag but with it, it give me some error. I have tried to debug it but haven't had a luck for now. Have anybody else faced the same issue?

Additional

Execution command followed:
python3 export.py --weights checkpoints/yolov5n.pt --device 0 --include onnx

Error:
frame #55: __libc_start_main + 0xf3 (0x7f6a3025c083 in /lib/x86_64-linux-gnu/libc.so.6)
(function ComputeConstantFolding)
ONNX: export failure: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper__index_select)

Note: Now I know it says that two device are detected but I clearly mentioned device=0 in argument and it works without dynamic flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions