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

Met exception while exporting to onnx #5

Open
sylyt62 opened this issue May 16, 2023 · 0 comments
Open

Met exception while exporting to onnx #5

sylyt62 opened this issue May 16, 2023 · 0 comments

Comments

@sylyt62
Copy link

sylyt62 commented May 16, 2023

I've already setup the model and inputs as:

device(type='cuda', index=0)

model = attempt_load(args.weights, map_location=device) # load FP32 model
im = torch.zeros(1, 3, *imgsz).to(device) # image size(1,3,320,192) BCHW iDetection

But still met the following exeption:

Traceback (most recent call last):
File "D:\sdk\envs\smpl-py38-torch110-cu111\lib\site-packages\torch\onnx\utils.py", line 1529, in _export
graph, params_dict, torch_out = _model_to_graph(
File "D:\sdk\envs\smpl-py38-torch110-cu111\lib\site-packages\torch\onnx\utils.py", line 1172, in _model_to_graph
params_dict = _C._jit_pass_onnx_constant_fold(
RuntimeError: 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)
python-BaseException

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