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

export2onnx #53

Open
YSYS101010000 opened this issue Dec 26, 2024 · 0 comments
Open

export2onnx #53

YSYS101010000 opened this issue Dec 26, 2024 · 0 comments

Comments

@YSYS101010000
Copy link

我想将pth 模型导出onnx ,模型为“GLEE_SwinL_Scaleup10m.pth” 。
环境:
torch 2.1.0+cu121
torchvison 0.16.0+cu121
修改:
对 ./projects/GLEE/glee/models/glee_model.py/glee_model.py 中的forward 进行修改,
问题:
转换onnx过程中出现以下错误:
Traceback (most recent call last):
File "/mnt/data/ysbo/python_examples/GLEE-main_infertest/export2onnx.py", line 109, in
torch.onnx.export(model_, dummy_input, ONNX_name, verbose=True, input_names=input_names,do_constant_folding=True,
File "/home/xuekai/xuekai/software/miniconda3/envs/GLEEBAK/lib/python3.9/site-packages/torch/onnx/utils.py", line 516, in export
_export(
File "/home/xuekai/xuekai/software/miniconda3/envs/GLEEBAK/lib/python3.9/site-packages/torch/onnx/utils.py", line 1596, in _export
graph, params_dict, torch_out = _model_to_graph(
File "/home/xuekai/xuekai/software/miniconda3/envs/GLEEBAK/lib/python3.9/site-packages/torch/onnx/utils.py", line 1139, in _model_to_graph
graph = _optimize_graph(
File "/home/xuekai/xuekai/software/miniconda3/envs/GLEEBAK/lib/python3.9/site-packages/torch/onnx/utils.py", line 595, in _optimize_graph
_C._jit_pass_onnx_autograd_function_process(graph)
RuntimeError: required keyword attribute 'Subgraph' is undefined

特此请教一下,问题如何解决

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