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

onnx导出失败 #3

Open
DrewdropLife opened this issue Oct 9, 2024 · 0 comments
Open

onnx导出失败 #3

DrewdropLife opened this issue Oct 9, 2024 · 0 comments

Comments

@DrewdropLife
Copy link

你好,我尝试将GOT-OCR导出为onnx,但是遭遇了如下错误:
AttributeError: 'GOT' object has no attribute 'image_start_id'
我仔细查看后,发现GOT类和LLM类里都没有初始化self.image_start_id,翻看了相应的config.json文件,也没有image_start_id参数,只有一个image_start_token。
于是我手动在GOT类里初始化了一个self.image_start_id=151857,现在运行导出代码没有报错,结果如下:

 1.5625e-02  3.0518e-02 -3.2227e-02  1.9531e-01
-9.8145e-02  4.4434e-02 -6.8848e-02  1.4258e-01
-2.6611e-02  3.1982e-02  1.0352e-01 -9.6680e-02
 1.0742e-01  2.8809e-02 -2.0020e-01  7.2266e-02
-3.5889e-02  5.6641e-02  2.1973e-01 -7.4707e-02
[ torch.FloatTensor{1024,1024} ]

但发现最终没有保存任何的onnx文件,文件夹里为空。这是哪里出了问题?我的执行命令如下:
python llm-export/llm_export.py --path="GOT_weights/" --export --export_test --onnx_path="onnx/"

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