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

pickle module :EOFError Ran out of input #255

Closed
WanShaw opened this issue Jul 24, 2022 · 8 comments
Closed

pickle module :EOFError Ran out of input #255

WanShaw opened this issue Jul 24, 2022 · 8 comments

Comments

@WanShaw
Copy link

WanShaw commented Jul 24, 2022

when I want to use the model of vit_tiny_patch16_224 from flowvison module ,it prompt this EOFError: Ran out of input.
环境就是OneFlow实训平台的3090显卡:oneflow-0.7.0+torch-1.8.1-cu11.2-cudnn8

@shangguanshiyuan
Copy link

您好,我在oneflow 0.7.0和0.8.0的版本未能复现您的问题,是否方便提供更多的信息,比如出错的代码片段等,谢谢。

@WanShaw
Copy link
Author

WanShaw commented Jul 24, 2022

稍等一下

@WanShaw
Copy link
Author

WanShaw commented Jul 24, 2022

File "of_train.py", line 10, in
model = Vit_t_16_224_pre(num_classes=10, pretrained=True)
File "/workspace/of_Vit.py", line 6, in Vit_t_16_224_pre
model = vit_tiny_patch16_224(pretrained=pretrained)
File "/usr/local/miniconda3/lib/python3.7/site-packages/flowvision/models/vision_transformer.py", line 412, in vit_tiny_patch16_224
"vit_tiny_patch16_224", pretrained=pretrained, progress=progress, **model_kwargs
File "/usr/local/miniconda3/lib/python3.7/site-packages/flowvision/models/vision_transformer.py", line 382, in _create_vision_transformer
state_dict = load_state_dict_from_url(model_urls[arch], progress=progress)
File "/usr/local/miniconda3/lib/python3.7/site-packages/flowvision/models/utils.py", line 133, in load_state_dict_from_url
state_dict = flow.load(pretrained_weight_dir)
File "/usr/local/miniconda3/lib/python3.7/site-packages/oneflow/framework/check_point_v2.py", line 322, in load
res = pickle.loads(pickle_bytes)
EOFError: Ran out of input

@WanShaw
Copy link
Author

WanShaw commented Jul 24, 2022

单独执行的话,也会出现Segmentation fault (core dumped)

@shangguanshiyuan
Copy link

您好,这个of_train.py、of_Vit.py是您自己写的还是实训平台提供的?

@WanShaw
Copy link
Author

WanShaw commented Jul 24, 2022

自己实现的,调用模型代码
def Vit_t_16_224_pre(num_classes=10, pretrained=True):
from flowvision.models import vit_tiny_patch16_224
model = vit_tiny_patch16_224(pretrained=pretrained)
model.head = nn.Linear(in_features=192, out_features=num_classes)
return model

@WanShaw
Copy link
Author

WanShaw commented Jul 24, 2022

不好意思了,在训练文件里直接调用就没事了,谢谢了

@shangguanshiyuan
Copy link

好的,未能定位到您的问题,如果您已经解决了的话,这个issue稍后将会被关闭,如果遇到了其他问题也欢迎随时反馈。

@WanShaw WanShaw closed this as completed Jul 24, 2022
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

2 participants