Skip to content

Question about word2vec2text.py #3

@xiyubao

Description

@xiyubao

when I was converting GoogleNews-vectors-negative300.bin to GoogleNews-vectors-300d.voc.

Console told me :

D:\academic\LDC\tools>python word2vec2text.py GoogleNews-vectors-negative300.bin GoogleNews-vectors-300d.voc
exporting vectors
Traceback (most recent call last):
File "word2vec2text.py", line 20, in memorymap
mapped_file = mmap.mmap(fd, size, access=mmap.ACCESS_READ)
OverflowError: cannot fit 'int' into an index-sized integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "word2vec2text.py", line 45, in
with memorymap(args.source) as mvec,
File "D:\academic\python\lib\contextlib.py", line 59, in enter
return next(self.gen)
File "word2vec2text.py", line 25, in memorymap
mapped_file.close()
UnboundLocalError: local variable 'mapped_file' referenced before assignment

How should I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions