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

When I use Reinforcement learning with CIDEr reward,there is always keyerror mistake #11

Open
userpei opened this issue Dec 13, 2020 · 0 comments

Comments

@userpei
Copy link

userpei commented Dec 13, 2020

Traceback (most recent call last):
File "train.py", line 171, in
train(opt)
File "train.py", line 102, in train
reward = get_self_critical_reward(decoder, core_args, vrg_data, fc_feats, att_feats, weak_relas, att_masks, data, gen_result, opt)
File "/peng/pyx/WeakVRD-Captioning-master/misc/rewards_graph.py", line 60, in get_self_critical_reward
, cider_scores = CiderD_scorer.compute_score(gts, res)
File "cider/pyciderevalcap/ciderD/ciderD.py", line 48, in compute_score
(score, scores) = cider_scorer.compute_score(self._df)
File "cider/pyciderevalcap/ciderD/ciderD_scorer.py", line 199, in compute_score
score = self.compute_cider(df_mode)
File "cider/pyciderevalcap/ciderD/ciderD_scorer.py", line 173, in compute_cider
vec, norm, length = counts2vec(test)
File "cider/pyciderevalcap/ciderD/ciderD_scorer.py", line 122, in counts2vec
df = np.log(max(1.0, self.document_frequency[ngram]))
KeyError: ('4857', '8713', '344', '993')

The numbers are different each time

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