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

Error occurs when I use the tools/export.py #85

Open
zyqhnu opened this issue Feb 28, 2024 · 1 comment
Open

Error occurs when I use the tools/export.py #85

zyqhnu opened this issue Feb 28, 2024 · 1 comment

Comments

@zyqhnu
Copy link

zyqhnu commented Feb 28, 2024

Opencd is cool. And I try to use the ‘export.py to transfer .pth model into onnx.
with this:
python3 tools/export.py --config ./work_dirs/changer_ex_eva_256x256_levircd/changer_ex_eva_256x256_levircd.py --checkpoint ./work_dirs/changer_ex_eva_256x256_levircd/best_mIoU_iter_29000.pth

the error occurs

INFO:opencd:Namespace(config='/root/cd_test/rs-pangu-cd/code/work_dirs/changer_ex_eva_256x256_levircd/changer_ex_eva_256x256_levircd.py', checkpoint='/root/cd_test/rs-pangu-cd/code/work_dirs/changer_ex_eva_256x256_levircd/best_mIoU_iter_29000.pth', inputs=['1,3,256,256', '1,3,256,256'], model_name='model.onnx')
INFO:root:Shape of rope freq: torch.Size([324, 64])

Traceback (most recent call last):
  File "/root/cd_test/rs-pangu-cd/code/tools/export.py", line 65, in <module>
    main(args)
  File "/root/cd_test/rs-pangu-cd/code/tools/export.py", line 41, in main
    torch.onnx.export(
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/__init__.py", line 305, in export
    return utils.export(model, args, f, export_params, verbose, training,
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/utils.py", line 118, in export
    _export(model, args, f, export_params, verbose, training, input_names, output_names,
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/utils.py", line 719, in _export
    _model_to_graph(model, args, verbose, input_names,
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/utils.py", line 503, in _model_to_graph
    graph = _optimize_graph(graph, operator_export_type,
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/utils.py", line 232, in _optimize_graph
    graph = torch._C._jit_pass_onnx(graph, operator_export_type)
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/__init__.py", line 354, in _run_symbolic_function
    return utils._run_symbolic_function(*args, **kwargs)
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/utils.py", line 1038, in _run_symbolic_function
    return torch._C._jit_onnx_convert_pattern_from_subblock(block, n, env)
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/__init__.py", line 354, in _run_symbolic_function
    return utils._run_symbolic_function(*args, **kwargs)
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/utils.py", line 1061, in _run_symbolic_function
    return symbolic_fn(g, *inputs, **attrs)
  File "/usr/local/lib64/python3.9/site-packages/torch/onnx/symbolic_opset11.py", line 114, in index_put
    if indices_list[idx_].type().scalarType() == "Bool":
RuntimeError: rINTERNAL ASSERT FAILED at "/root/pytorch/aten/src/ATen/core/jit_type_base.h":540, please report a bug to PyTorch.

How can I solve it?

Environment:
torch 1.11.0
mmcv 2.1.0
mmdet 3.2.0
mmengine 0.10.3
mmsegmentation 1.2.2

@GreatV
Copy link
Contributor

GreatV commented Apr 18, 2024

hi @zyqhnu, This looks like an internal pytorch error.

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

2 participants