TypeError: float() argument must be a string or a number, not 'map'
Binathi opened this issue · comments
When I run the command
python preprocess_embedding.py --embedding glove.840B.300d.txt --dict ./data/qg.tgt.dict --output ./data/qg.tgt.840B.300d.npy
Error:
Unknown word:
Traceback (most recent call last):
File "preprocess_embedding.py", line 76, in
main()
File "preprocess_embedding.py", line 64, in main
embedding[i] = word2embedding[w]
TypeError: float() argument must be a string or a number, not 'map'
Any ideas?
As the code was written in python2, ran the command as follows
python2 preprocess_embedding.py --embedding glove.840B.300d.txt --dict ./data/qg.tgt.dict --output ./data/qg.tgt.840B.300d.npy