Closed pdc-kaminaga closed 4 years ago
Hi, Thank you for your question!
This error is mainly my fault for hardcoding the vocab_sizes (sorry 🙇♂️). As the Tatoeba parallel corpus might have changed, en_vocab_size and jp_vocab_size also change. As a result, you're seeing the above error message:
InvalidArgumentError: indices[0,7] = 137 is not in [0, 135)
Here is how you fix this issue:
in Preprocessing.ipynb please confirm the size of eng_dict
and jpn_dict
:
en_vocab_size = len(eng_dict)
ja_vocab_size = len(jpb_dict)
then in both notebooks used for training and testing, substitute the part where en_vocab_size
and jp_vocab_size
are defined with the above mentioned numbers:
en_vocab_size = <en_vocab_size> + 4
jp_vocab_size = <ja_vocab_size> + 4
I hope this fix your problem. Let me know if it's still unclear.
Thanks for your reply. I'll try my best!
Preprocessing.ipynb In[7] en_vocab_size = len(eng_dict) ja_vocab_size = len(jpn_dict) print(en_vocab_size) --> 139 print(ja_vocab_size) --> 3208
Train.ipynb In[5] preprocessing_en_vocab_size = 139 preprocessing_ja_vocab_size = 3208 en_vocab_size = preprocessing_en_vocab_size + 4 jp_vocab_size = preprocessing_ja_vocab_size + 4
Test.ipynb In[6] preprocessing_en_vocab_size = 139 preprocessing_ja_vocab_size = 3208 en_vocab_size = preprocessing_en_vocab_size + 4 jp_vocab_size = preprocessing_ja_vocab_size + 4
Hello.
I got InvalidArgumentError by running Test [GLU].ipynb. Please tell me how to solve this problem?
python: 3.7.5rc1 torch:1.4.0
In [19]: translate(["It's windy tomorrow"])
InvalidArgumentError Traceback (most recent call last) ~/python_env/FAIRSEQ/lib/python3.7/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, args) 1355 try: -> 1356 return fn(args) 1357 except errors.OpError as e:
~/python_env/FAIRSEQ/lib/python3.7/site-packages/tensorflow/python/client/session.py in _run_fn(feed_dict, fetch_list, target_list, options, run_metadata) 1340 return self._call_tf_sessionrun( -> 1341 options, feed_dict, fetch_list, target_list, run_metadata) 1342
~/python_env/FAIRSEQ/lib/python3.7/site-packages/tensorflow/python/client/session.py in _call_tf_sessionrun(self, options, feed_dict, fetch_list, target_list, run_metadata) 1428 self._session, options, feed_dict, fetch_list, target_list, -> 1429 run_metadata) 1430
InvalidArgumentError: indices[0,7] = 137 is not in [0, 135) [[{{node embedding/embedding_lookup}}]]
During handling of the above exception, another exception occurred:
InvalidArgumentError Traceback (most recent call last)