Open weiwancheng opened 7 years ago
Create a separate .py with np.load('skipthoughts/models/btable.npy',encoding='latin1') to open,but i can not open btable.npy.
this error, EOFError: Ran out of input
I am experiencing the same problem. Did you get it right?
/Users/hrushikeshjadhav/anaconda3/lib/python3.7/site-packages/sklearn/feature_extraction/text.py:17: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Mapping, defaultdict Starting to encode... Loading pre-trained models... Loading model parameters... Compiling encoders... Loading tables... Traceback (most recent call last): File "/Users/hrushikeshjadhav/anaconda3/lib/python3.7/site-packages/numpy/lib/format.py", line 657, in read_array array = pickle.load(fp, **pickle_kwargs) UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 1: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "edd.py", line 116, in
To solve the problem you have to add the paramater encoding = 'latin1' to numpy.load() The default encoding in Python 2 is ascii and in Python 3 it is utf-8. latin1 (a.k.a., ISO-8859-1) is a superset of ascii and it should work.
Traceback (most recent call last): File "C:\Users\Administrator\Anaconda3\lib\site-packages\numpy\lib\format.py", line 637, in read_array array = pickle.load(fp, **pickle_kwargs) UnicodeDecodeError: 'ascii' codec can't decode byte 0xb2 in position 1: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "data_loader.py", line 111, in
main()
File "data_loader.py", line 106, in main
save_caption_vectors_flowers(args.data_dir)
File "data_loader.py", line 77, in save_caption_vectors_flowers
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 85, in load_tables
utable = numpy.load(path_to_tables + 'utable.npy')
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 643, in readarray
"to numpy.load" % (err,))
UnicodeError: Unpickling a python object failed: UnicodeDecodeError('ascii', b'z\xb2J=\xb1W!=\xe9\x9d\x07\xbdg\xfa\x89\xbd\xc2\x0b\xcd\xbd\xbb\xa5\x84\xbc\xb4\xab5=S\xa0\x84<\x82d\x13=\xd8q\xed<\xfd\
x02\x92\xe6E\x14=-}\x08<G\xfa\x9f\xbd\x12\x93\x01;r\x81\x93\xbdhwU\xbdL\x98!\xbd\xca\x89\xdd\xbaN1\x85=@\x04\xbb=VA\xbe\xbd\xfb(\x02\xa9\x07\x92\xbdJ<\x8f=\'\xadW<\xea\xf2\xe9<\xe7\x1d\xc9\xbc\x06\
x13\xbd\xf2\x07]=\xf7\x9c==\xa13U=\x13\xc4(\xbd\xf6X\x03\xbcT\x1e\xfc;\xe0\xad\xbf=A(\xbd\xad\xc7\xa2\xbb\xc8\x0f\x07\xbdKC\x14\xbd\x9f\x01\xd1<+w\xe0=\x0b\x95\x9f=OZ\x00=\xd5\xfa\n<\xb2\x81a\xbd\x
1cB\x80=\xb7\'\x8a=\x01\x0f\x13\xbb(\xfb\x97=\xc4\x9c\'<\xc8x\xb3\xbc8{(\xbd\x82r\x96<\xb5\xf4l\xbd\x03*\xad\xbdl\xda\xf0\xbb\xbd\x91\x9f\xbaK\xc4\xd2=\x8cz\x0e=\xc5\x10\xb1=\xea\x0c\xd7;\xaft\x8d=\x
e42\x00\xbe\x06\xa2\x98=\x16\x02r\xbd4\xc7?=\xd6Y?\xbc\xf4]\x15\xbd\xd2D\x95\xbc\n\xf2\x1e="\xce\xea<\x89u]\xbd\x1b\x97\x86\xbc4\xee\t>2%\xc8\xbdE\xf5}\xbd\xa9h\x18=\x05\x15\x8c\xbc}\xc5a\xbd%\xe8\x9
9=\xdf\x06\xc2\xbb!G]\xbb\xa7o\xca;Oen<n`\xa8<\xc7\x00\xa1=0\xde\xa2\xbd#OI=g$9=\xe0\xf2\x07\xbd\xd31\\xbc\x8c\x93\x97\xbc\x1d\x94\t\xbcI\x1bg\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0\x843\xbdJo\x9e\xbd\xb0\xb1O\xbd{{?=\x8eg\x14;\xe3\xdd\x0f\xbd\x87UX;\xb5\x83R\xbd\xce\x84\xa5\xbc\x94@==\x00\xbd\x0f\xbdz\xea\xe2\xbc\xe9.{\xbc\x7f\x9e\xf3\xbc\xc5\x1fT=
\xb3Wt=&\xb9\xd0<y\xf9/=\x8er\xa2\xbb\x85k#<#<\x1a\xbd\x18"I\xbd\x81\x1c\xbd=M\xbb\x9d<cM\xfe\xbc@\xa2/\xbb\xd2\x8b\xf7\xbc\xcd{\xa7\xbbxDC\xbc\xccL\x199n\xb8P\xbc\x94\x06D=E*\x85=\x82\xadZ=L\xea(\xb
c0\xc0D\xbd\x82\xcf\x80\xbcH\xa7\x98\xbc\xb2\x81[\xbdX\'b=\xebC}\xbd\x1c\xe9Y;', 1, 2, 'ordinal not in range(128)')
You may need to pass the encoding= option to numpy.load
I modify "import cPickle as pkl" to "import pickle as pkl". Now, I have this problem. Can you help me solve this problem?