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

无法保存模型文件 #10337

Open
levi131 opened this issue Sep 27, 2023 · 1 comment
Open

无法保存模型文件 #10337

levi131 opened this issue Sep 27, 2023 · 1 comment
Assignees
Labels
bug community events from community

Comments

@levi131
Copy link
Contributor

levi131 commented Sep 27, 2023

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'

System Information

  • What is your OneFlow installation (pip, source, dockerhub): dockerhub
  • OS: Ubuntu 18.04.6 LTS
  • OneFlow version (run python3 -m oneflow --doctor): 0.9.1.dev20230630+cu117
  • Python version: Python 3.8.16
  • CUDA driver version: 11.7
  • GPU models:
  • Other info:
@levi131 levi131 added bug community events from community labels Sep 27, 2023
@levi131 levi131 assigned levi131 and ShawnXuan and unassigned levi131 Sep 27, 2023
@levi131 levi131 changed the title 无法保存模型文件 [模型适配] 无法保存模型文件 Sep 27, 2023
@levi131 levi131 changed the title [模型适配] 无法保存模型文件 **模型适配** 无法保存模型文件 Sep 27, 2023
@levi131 levi131 changed the title **模型适配** 无法保存模型文件 无法保存模型文件 Sep 27, 2023
@levi131
Copy link
Contributor Author

levi131 commented Oct 10, 2023

#10338 中修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug community events from community
Projects
None yet
Development

No branches or pull requests

2 participants