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

UnicodeDecodeError #2

Open
Yan-echo opened this issue May 11, 2019 · 1 comment
Open

UnicodeDecodeError #2

Yan-echo opened this issue May 11, 2019 · 1 comment

Comments

@Yan-echo
Copy link

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 5: ordinal not in range(128)
File "main.py", line 140, in
main()
File "main.py", line 113, in main
data_list, labels_list = load_features()
File "main.py", line 24, in load_features
d = pickle.load(f)

what should I do?

@bbenligiray
Copy link
Owner

Either of the following:
1 - Use python 2.7
2 - Modify the pickle.load line as below:

def load_features():
    with open('ck+preprocessed.p', 'rb') as f:
        d = pickle.load(f, encoding='latin1')
    return d['spatial_features'], d['labels']

Repository owner deleted a comment from Obasoro Feb 20, 2024
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