• Register
0 votes
1k views

Problem :

Getting bellow error while executing numpy arrays
unicodedecodeerror: 'ascii' codec can't decode byte 0x90 in position 614: ordinal not in range(128)
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I had the similar error in the past but bellow code worked for me. 

Note : The encoding='latin1' is the most important part.

# read in data from pickle file created with Load_Data.py
pickle_file = 'mnist.pkl'
with open(pickle_file, 'rb') as f:
    train_set, valid_set, test_set = pickle.load(f, encoding='latin1')

Further Readings:

9 7 4
38,600 points

Related questions

0 votes
1 answer 6 views
6 views
Problem: How to fix: “UnicodeDecodeError: 'ascii' codec can't decode byte”
asked Mar 16 ummesalma 25.2k points
0 votes
1 answer 1 view
1 view
Problem: What are my options for dealing with this issue? Unicodedecodeerror: 'utf-8' codec can't decode byte 0x83 in position 0: invalid start byte.
asked Apr 1 rakib1 51.5k points
0 votes
1 answer 30 views
30 views
Problem: This problem happened with me any help? Unicodedecodeerror: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte.
asked Mar 7 Wafa Abu Yousef 6.1k points
0 votes
1 answer 30 views
30 views
Problem : What may be the cause of the error: Unicodedecodeerror: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte.
asked Mar 6 Wafa Abu Yousef 6.1k points
0 votes
1 answer 648 views
648 views
Problem : Please find below my code for your reference. import os for root, dirs, files in os.walk('Path'):      for file in files:          if file.endswith('.c'):              with open(os.path.join(root, file)) as f:                     for line in f: ... already tried setting it with the open(os.path.join(root, file),'r',encoding='cp932') as f: but got the same above error
asked Jan 31, 2020 jwilliam 3.9k points
0 votes
1 answer 2.7K views
2.7K views
Problem : I am new to the Python, I am using Python-2.6 CGI scripts but facing following error in the server log while I was doing json.dumps(), Traceback (most recent call last): File "/etc/mongodb/server/cgi-bin/getstats.py", line 135, in <module> print json.dumps ... = datetime.datetime.strftime(now, '%Y-%m-%dT%H:%M:%S.%fZ') print json.dumps({'current_time': now}) // I guess this is the culprit
asked Nov 24, 2019 alecxe 7.5k points
0 votes
2 answers 8.7K views
8.7K views
Problem : I have encountered the following error while compiling "process.py" python tools/process.py --input_dir data -- operation resize --outp ut_dir data2/resize data/0.jpg -> data2/resize/0.png Traceback (most recent call last): File "tools/process.py", line 235, in <module ... 0xff in position 0: invalid start byte What may be the cause of the error? I am using Python's version as 3.5.2.
asked Nov 22, 2019 peterlaw 6.9k points
0 votes
1 answer 9 views
9 views
Problem: How to I Solve this: unicodedecodeerror: 'ascii' codec decode byte HELP! I need help understanding this: unicodedecodeerror: 'ascii' codec decode byte Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 5 Mashhoodch 13k points
0 votes
1 answer 4 views
4 views
Problem: How to I Solve this: ascii' codec can't decode byte HELP! I need help understanding this: ascii' codec can't decode byte Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 5 Mashhoodch 13k points
0 votes
2 answers 720 views
720 views
Problem : I want to read my .csv file into Python (Spyder) but I am facing the error. Please find below my code : import csv mydata = open("C:\Users\miche\Documents\school\jaar2\MIK\2.6\vektis_agb_zorgverlener") mydata = csv.reader(mydata) print(mydata) I face the following error: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
asked Dec 6, 2019 alecxe 7.5k points