chuangg / tdw-transport-challenge-starter-code

27 stars 2 forks source link

Error getting the dataset from the "train_dataset.pkl" #3

Closed VicenteMorell closed 3 years ago

VicenteMorell commented 3 years ago

Hello, I'm testing the challenge "test.py" but I can't get the dataset from the pickle "train_dataset.pkl". It seems that the enconding of the file is not compatible with the one I'm using. I tried to use the common encodings in the open function but none of them worked. Is there any way I can load that scenes? Thanks in advance!

File "c:/Users/bison/Google Drive/Universidad/Workspaces/Py3/prueba/gymTransportControllerP.py", line 16, in <module> dataset = pickle.load(fp) File "C:\Users\bison\AppData\Local\Programs\Python\Python38\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 3271: character maps to <undefined>

abhi1092 commented 3 years ago

Are you opening the file in binary mode?

with open("train_dataset.pkl", "rb") as fp:
     dataset = pickle.load(fp)
abhi1092 commented 3 years ago

I have updated the test.py file too