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

无法保存模型文件 #408

Open
lucifffer opened this issue Sep 26, 2023 · 0 comments
Open

无法保存模型文件 #408

lucifffer opened this issue Sep 26, 2023 · 0 comments

Comments

@lucifffer
Copy link

Summary

使用0.9.1.dev20230630+cu117版本的oneflow在保存由torch转换的模型时在最后报错。使用0.9.0版本不会报错,能成功保存模型

Code to reproduce bug

from models.NLP.roberta.models.roberta import Roberta
flow_model = Roberta(**kwargs)
flow_model.load_state_dict(torch_para, False)
flow.save(flow_model.state_dict(), "/root/autodl-tmp/oneflow_trans/oneflow/chemberta")

报错:
Traceback (most recent call last):
File "chemberta.py", line 35, in
flow.save(flow_model.state_dict(), "/code/oneflow/oneflow_chemberta")
File "/opt/conda/lib/python3.8/site-packages/oneflow/framework/check_point_v2.py", line 737, in save
write_file()
File "/opt/conda/lib/python3.8/site-packages/oneflow/framework/check_point_v2.py", line 723, in write_file
with _open_file_like(path_or_buffer, "wb") as f:
File "/opt/conda/lib/python3.8/site-packages/oneflow/framework/check_point_v2.py", line 99, in _open_file_like
return _open_file(path_or_buffer, mode)
File "/opt/conda/lib/python3.8/site-packages/oneflow/framework/check_point_v2.py", line 80, in init
super(_open_file, self).init(open(path, mode))
IsADirectoryError: [Errno 21] Is a directory: '/code/oneflow/oneflow_chemberta'

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