Skip to content

python3 compatibility#53

Open
ca-joe-yang wants to merge 3 commits into
ryankiros:masterfrom
ca-joe-yang:master
Open

python3 compatibility#53
ca-joe-yang wants to merge 3 commits into
ryankiros:masterfrom
ca-joe-yang:master

Conversation

@ca-joe-yang

Copy link
Copy Markdown

No description provided.

@AlphaWill0

AlphaWill0 commented Jul 22, 2017

Copy link
Copy Markdown

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
Copy Markdown
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.

@AlphaWill0

Copy link
Copy Markdown

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