Tag Archives: Python

UnicodeDecodeError on RaspberryPi – Python

Hey everyone,

I ran into the following error while trying to read serial input on a Raspberry Pi hooked up to an Arduino via USB:

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0za8 in position 0: invalid start byte

The solution was as follows:

#buffer_string = ser.read().decode('utf-8')
buffer_string = ser.read().decode('utf-8', errors='replace')

Thanks to the following link: https://github.com/OpenBCI/OpenBCI_Python/issues/24

TensorFlow – KeyError: “The name ‘import/input’ refers to an Operation not in the graph.

Hey everyone,

Just another small error I’ve run into while testing out Tensorflow’s label image example (Tensorflow/tensorflow/examples/image_retraining/label_image.py):

KeyError: "The name 'import/input' refers to an Operation not in the graph.

This one thankfully doesn’t seem to be my fault. In label_image.py change the following lines:

# Line 78-79
input_layer = "input"
output_layer = "InceptionV3/Predictions/Reshape_1"

# Change to this
input_layer = "Mul"
output_layer = "final_result"

Once that’s done just rerun your script and it should all work. Thanks to the following post for the solution: https://github.com/tensorflow/tensorflow/issues/12736