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

python3 compatibility #53

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

ca-joe-yang
Copy link

No description provided.

@weiwancheng
Copy link

weiwancheng commented Jul 22, 2017

I run this code on python3, and I get a error,plaese help me.

Traceback (most recent call last):
File "G:/postgradute_learn/01code/text-to-image-master/generate_thought_vectors.py", line 33, in
main()
File "G:/postgradute_learn/01code/text-to-image-master/generate_thought_vectors.py", line 23, in main
model = skipthoughts.load_model()
File "G:\postgradute_learn\01code\text-to-image-master\skipthoughts.py", line 64, in load_model
utable, btable = load_tables()
File "G:\postgradute_learn\01code\text-to-image-master\skipthoughts.py", line 87, in load_tables
utable = numpy.load(path_to_tables + 'utable.npy', encoding='latin1')
File "C:\Users\Administrator\Anaconda3\lib\site-packages\numpy\lib\npyio.py", line 406, in load
pickle_kwargs=pickle_kwargs)
File "C:\Users\Administrator\Anaconda3\lib\site-packages\numpy\lib\format.py", line 637, in read_array
array = pickle.load(fp, **pickle_kwargs)
EOFError: Ran out of input

@ca-joe-yang
Copy link
Author

I am sorry, I don't think you're running the same code version as the one I posted here.
This is a slightly modified skipthought.py which should be able to run in python3.
The original one (master branch) can only run in python2.
I think you should start a new issue.

Despite this, I think the problem here is that you pickle loaded an empty file.
Similar problem can be found here:
https://stackoverflow.com/questions/24791987/why-do-i-get-pickle-eoferror-ran-out-of-input-reading-an-empty-file

I think you should check what the variable 'path_to_tables' really is, perhaps print the variable out.
Also check whether the file path_to_tables + 'utable.npy' exists or not.

@weiwancheng
Copy link

Thank you for your reply.
I have found the couse of the error. because utable.npy file has gone bad,so load have an error. I download it again, it can work.
Anyway, thank you for your contribution.

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

Successfully merging this pull request may close these issues.

5 participants