Issue
Why this works
sed -n '242p' /usr/local/lib/python3.6/site-packages/keras/models.py
model_config = json.loads(model_config.decode('utf-8'))
sed -i "242s/.decode('utf-8')//" /usr/local/lib/python3.6/site-packages/keras/models.py
sed -n '242p' /usr/local/lib/python3.6/site-packages/keras/models.py
model_config = json.loads(model_config)
and this doesn´t
sed -n '3328p' /usr/local/lib/python3.6/site-packages/keras/engine/topology.py
original_keras_version = f.attrs['keras_version'].decode('utf8')
sed -i "3328s/.decode('utf-8')//" /usr/local/lib/python3.6/site-packages/keras/engine/topology.py
sed -n '3328p' /usr/local/lib/python3.6/site-packages/keras/engine/topology.py
original_keras_version = f.attrs['keras_version'].decode('utf8')
Why I cannot delete the second .decode('utf8')
. It is because it is at the end of the string.
I could another approach but I would like to be consistent with the code. I don't get any errors so I don't know what to do although I have been working around and looking for the answer on Internet.
Solution
There's an important one character difference:
utf8
utf-8
Answered By - choroba Answer Checked By - Gilberto Lyons (WPSolving Admin)