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

eval erro #18

Open
18292875242 opened this issue Apr 30, 2019 · 5 comments
Open

eval erro #18

18292875242 opened this issue Apr 30, 2019 · 5 comments

Comments

@18292875242
Copy link

您好,使用您github上的参数训练模型,在eval时遇到了如下错误:
Traceback (most recent call last):
File "eval.py", line 137, in
vars(opt))
File "/home/dusen/YKQ/Image_Captioning_AI_Challenger/eval_utils.py", line 97, in eval_split
data['att_masks'][np.arange(loader.batch_size) * loader.seq_per_img]]
KeyError: 'att_masks'
希望能得到您的解答,万分感谢!

@ruotianluo
Copy link
Owner

那就直接设为none吧

@18pxrsun
Copy link

设为none之后又会有其他的问题:
Traceback (most recent call last):
File "eval.py", line 138, in
vars(opt))
File "/home1/ykqHD/master/eval_utils.py", line 102, in eval_split
seq = model(fc_feats, att_feats,opt=eval_kwargs, mode='sample')[0].data
File "/home1/public/software/anaconda3/envs/pytorch0.2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, **kwargs)
File "/home1/ykqHD/master/models/CaptionModel.py", line 31, in forward
return getattr(self, '_'+mode)(*args, **kwargs)
File "/home1/ykqHD/master/models/AttModel.py", line 189, in _sample
return self._sample_beam(fc_feats, att_feats, att_masks, opt)
File "/home1/ykqHD/master/models/AttModel.py", line 175, in sample_beam
self.done_beams[k] = self.beam_search(state, logprobs, tmp_fc_feats, tmp_att_feats, tmp_p_att_feats, tmp_att_masks, opt=opt)
File "/home1/ykqHD/master/models/CaptionModel.py", line 121, in beam_search
args = [
.chunk(group_size) for _ in args]
AttributeError: 'NoneType' object has no attribute 'chunk'

@ruotianluo
Copy link
Owner

你去看一下self critical..pytorch,那个里面都fix了基本上

@18pxrsun
Copy link

那个里面的eval.py好像没有denseatt:
Traceback (most recent call last):
File "eval.py", line 102, in
model = models.setup(opt)
File "/home1/pxrHD/ImageCaptioning.pytorch-master/models/init.py", line 42, in setup
raise Exception("Caption model not supported: {}".format(opt.caption_model))
Exception: Caption model not supported: denseatt

@ruotianluo
Copy link
Owner

Denseatt should be in self critical pytorch.

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