glove-python icon indicating copy to clipboard operation
glove-python copied to clipboard

python 3 incompatibility in glove.py

Open hippozhu opened this issue 9 years ago • 0 comments

In line 166 and 167 word_ids = np.array(cooccurrence.keys(), dtype=np.int32) values = np.array(cooccurrence.values(), dtype=np.float64)

gives

TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict_keys'

Changing them to the following solved the issue: word_ids = np.array(list(cooccurrence.keys()), dtype=np.int32) values = np.array(list(cooccurrence.values()), dtype=np.float64)

hippozhu avatar Jun 30 '16 03:06 hippozhu