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

Exception has occurred: UnicodeDecodeError #8

Open
zhfff4869 opened this issue Dec 2, 2020 · 1 comment
Open

Exception has occurred: UnicodeDecodeError #8

zhfff4869 opened this issue Dec 2, 2020 · 1 comment

Comments

@zhfff4869
Copy link

zhfff4869 commented Dec 2, 2020

Exception has occurred: UnicodeDecodeError
'ascii' codec can't decode byte 0xeb in position 2: ordinal not in range(128)

Hi vonfeng,when I execute data = pickle.load(open(self.data_path + self.data_name + '.pk', 'rb'))
it occur the exception.Could you please tell me the reason and how to load the data correctly? thanks

@zhfff4869
Copy link
Author

zhfff4869 commented Dec 21, 2020

ah,I have solved it. the foursquare.pk has to be load by latin1 encoding.By the way I use python3 so I change the code adapt to py3, and torch is newer version but it is ok and nothing about it need to be changed.
for this problem I change the code to:
with open(self.data_path + self.data_name + '.pk', 'rb') as f: data = pickle.load(f,encoding='latin1')

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

1 participant