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

No such file or directory: 'output/mlp_finetune/checkpoint-35000.pt #7

Open
yywhsgnd opened this issue Dec 28, 2022 · 19 comments
Open

Comments

@yywhsgnd
Copy link

2022-12-28 11:48:11.682 | INFO | models.model:init:80 - random initialize gpt2 model
Traceback (most recent call last):
File "predict.py", line 186, in
main(args)
File "predict.py", line 129, in main
model.load_state_dict(torch.load(args.model_path, map_location=args.device))
File "/home/jupyter/miniforge3/envs/env1/lib/python3.7/site-packages/torch/serialization.py", line 699, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/jupyter/miniforge3/envs/env1/lib/python3.7/site-packages/torch/serialization.py", line 231, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/jupyter/miniforge3/envs/env1/lib/python3.7/site-packages/torch/serialization.py", line 212, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'output/mlp_finetune/checkpoint-35000.pt

@Espere-1119-Song
Copy link

maybe you can find checkpoint-35000.pt in directory finetune under directory output

@yywhsgnd
Copy link
Author

yywhsgnd commented Dec 28, 2022 via email

@Espere-1119-Song
Copy link

那你有遇到过这个问题吗

Traceback (most recent call last):
File "predict.py", line 197, in
main(args)
File "predict.py", line 156, in main
captions = generate(model, clip_embeds, tokenizer, args)
File "predict.py", line 80, in generate
out = model.gpt2(inputs_embeds=inputs_embeds)
File "/home/exs/Anaconda3/envs/cliipcap/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/home/exs/Anaconda3/envs/cliipcap/lib/python3.8/site-packages/transformers/models/gpt2/modeling_gpt2.py", line 971, in forward
lm_logits = self.lm_head(hidden_states)
File "/home/exs/Anaconda3/envs/cliipcap/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/home/exs/Anaconda3/envs/cliipcap/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 105, in forward
return F.linear(input.float(), self.weight.float(), self.bias.float())
AttributeError: 'NoneType' object has no attribute 'float'

@yywhsgnd
Copy link
Author

yywhsgnd commented Dec 28, 2022 via email

@Espere-1119-Song
Copy link

train完no_finetune之后predict的时候

@yywhsgnd
Copy link
Author

yywhsgnd commented Dec 28, 2022 via email

@Espere-1119-Song
Copy link

是这样的

@yywhsgnd
Copy link
Author

yywhsgnd commented Dec 28, 2022 via email

@Espere-1119-Song
Copy link

我把train的数据集给换了

@yywhsgnd
Copy link
Author

我把train的数据集给换了

你这情况我也没有用到,我的建议是你继续用flickr30的数据集复现一下,我用mlp生成时就只出现了torch和cpu\gpu的问题

@Espere-1119-Song
Copy link

好的谢谢

@yywhsgnd
Copy link
Author

yywhsgnd commented Dec 28, 2022 via email

@Espere-1119-Song
Copy link

哈哈哈哈我还没生成出来呢,执行finetune.sh的时候报错了

@yywhsgnd
Copy link
Author

哈哈哈哈我还没生成出来呢,执行finetune.sh的时候报错了

好像readme里面生成那里finetune是finerune

@Espere-1119-Song
Copy link

那个我看到了

@yywhsgnd
Copy link
Author

yywhsgnd commented Dec 28, 2022 via email

@Espere-1119-Song
Copy link

额……我换了其他的image-caption数据集,预训练用的是gpt2,不是chinesegpt2

@yywhsgnd
Copy link
Author

yywhsgnd commented Dec 28, 2022 via email

@xiaozhouoo
Copy link

请问一下您怎么解决的

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