chuangg/tdw-transport-challenge-starter-code

Error getting the dataset from the "train_dataset.pkl"

Closed this issue · 2 comments

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>

Are you opening the file in binary mode?

with open("train_dataset.pkl", "rb") as fp:
     dataset = pickle.load(fp)

I have updated the test.py file too