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

AttributeError: module 'paddle.fluid' has no attribute 'load_dygraph' #95

Open
ziFan99 opened this issue Jan 14, 2025 · 2 comments
Open

Comments

@ziFan99
Copy link

ziFan99 commented Jan 14, 2025

我在进行paddle转成pytorch模型的时候,遇到这个报错信息:
Traceback (most recent call last):
File "./converter/ch_ppocr_v4_rec_server_converter.py", line 112, in
converter = PPOCRv4RecConverter(cfg, paddle_pretrained_model_path)
File "./converter/ch_ppocr_v4_rec_server_converter.py", line 12, in init
para_state_dict, opti_state_dict = self.read_paddle_weights(paddle_pretrained_model_path)
File "/root/autodl-tmp/PaddleOCR2Pytorch-main/pytorchocr/base_ocr_v20.py", line 97, in read_paddle_weights
para_state_dict, opti_state_dict = fluid.load_dygraph(weights_path)
AttributeError: module 'paddle.fluid' has no attribute 'load_dygraph'
我使用的命令是: python ./converter/ch_ppocr_v4_rec_server_converter.py --yaml_path /root/autodl-tmp/PaddleOCR-2.9.1/models/rec/recv4_hgnet_server_Augcustom/config.yml --src_model_path /root/autodl-tmp/PaddleOCR-2.9.1/models/rec/recv4_hgnet_server_Augcustom
请问这个是什么问题?

@frotms
Copy link
Owner

frotms commented Jan 14, 2025

可能是新版paddle去掉这个接口了

@KienTranDSAI
Copy link

That's true! Then, how can we convert with the newest version of paddle (without degrading ther version)?

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

3 participants