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

Skipthought.py #32

Open
Mansijain850 opened this issue Oct 10, 2017 · 1 comment
Open

Skipthought.py #32

Mansijain850 opened this issue Oct 10, 2017 · 1 comment

Comments

@Mansijain850
Copy link

I am getting this error. Can anyone help me with this?
` File "/root/anaconda3/lib/python3.5/site-packages/numpy/lib/format.py", line 640, 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 "", line 1, in
File "/root/neural-storyteller/skip-thoughts/skipthoughts.py", line 59, in load_model
utable, btable = load_tables()
File "/root/neural-storyteller/skip-thoughts/skipthoughts.py", line 79, in load_tables
utable = numpy.load(path_to_tables + 'utable.npy')
File "/root/anaconda3/lib/python3.5/site-packages/numpy/lib/npyio.py", line 419, in load
pickle_kwargs=pickle_kwargs)
File "/root/anaconda3/lib/python3.5/site-packages/numpy/lib/format.py", line 646, in read_array
"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\x1cB\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=\xe42\x00\xbe\x06\xa2\x98=\x16\x02r\xbd4\xc7?=\xd6Y?\xbc\xfw\xed<U\t\x9a\xbc\xfb\xd3\xa5<\xda\xce\x98\xba\xe0C8=t\xfa\x04\xbc\xbe\xdf\xf5\xbc\xb7\xbf\x00<\xef\x92\xd5:\xda\x05\x8f\xbd\xc4D\xaa=21\xbb\xbc\x92\x80\x8c=\x04\xef\x8b\xba\x1d!\xf5<\xc1\xcb\xe1\xbc\xca\x17*=\xdd\x16\xfd<SP0\xbd\x88>\xb1\xbd&\xb95<\xfb\x15\xa6\xbc<\x19"\xbcO\x7f\x0e\xbc\x95\xd6.=l\x15\x87<G]\xd0;#}\xc1\xbb5\_\xbb\xc4\x8a\x87=1\xd8\x8f=C\x06\xea;\xbb\xbd\xde=4\xb1\x0f\xbd\xa8\xfc\xd9\xbc&\xcf\xb3=\xe5\x99\x0e\xbdA{\xa1\xbd$[I=\xdc\x0c\xdf<E\x10s=\xd5\xf7\xbc\xcd{\xa7\xbbxDC\xbc\xccL\x199n\xb8P\xbc\x94\x06D=E\x85=\x82\xadZ=L\xea(\xbc0\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`

@cuuupid
Copy link

cuuupid commented Nov 25, 2017

in skipthoughts.py:

    utable = numpy.load(path_to_tables + 'utable.npy', encoding='latin1')
    btable = numpy.load(path_to_tables + 'btable.npy', encoding='latin1')

Adding encoding='latin1' allows it to decode those characters.

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

No branches or pull requests

2 participants