windows system:
original_keras_version = f.attrs[‘keras_version’].decode(‘utf8’)
1. error:
load_weights_from_hdf5_group
original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
2. Cause analysis
When installing tensorflow, the default installed h5py is 3.1.0, and an error is reported because the TF you installed does not support an excessively high version of h5py
3. Solutions
1. Uninstall h5py3 Version 1.0, installing h5py2.0 Version 10.0.2. Restart the compiler
pip install h5py==2.10.0
Read More:
- [Solved] R Error: Python module tensorflow.keras was not found.
- from keras.preprocessing.text import Tokenizer error: AttributeError: module ‘tensorflow.compat.v2‘ has..
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- [Solved] AttributeError: ‘str‘ object has no attribute ‘decode‘
- How to Solve keras load_model() Error
- [Solved] Python Keras Error: AttributeError: ‘Sequential‘ object has no attribute ‘predict_classes‘
- [Solved] Original error was: No module named ‘numpy.core._multiarray_umath‘
- Python 3.7 Error: AttributeError: ‘str‘ object has no attribute ‘decode‘ [How to Solve]
- [Solved] appium Error: Original error: socket hang up
- Pycharm error: original error was: DLL load failed while importing _multiarray _Umath: the specified module could not be found
- [Solved] RuntimeError: Cannot clone object <keras.wrappers.scikit_learn.KerasClassifier object…
- [Solved] Original error was: DLL load failed while importing _multiarray_umath
- Keras import package error: importerror: cannot import name ‘get_ config‘
- Djangorestframework-simplejwt: ‘str‘ object has no attribute ‘decode‘ [Solved]
- [Solved] SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 6-7: malformed
- [Solved] SyntaxError: (unicode error) ‘utf-8’ codec can’t decode byte 0xbe in position 0
- How to Solve Pytorch DataLoader Loading Error: UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xe5 in position 1023
- [Solved] git review Error: UnicodeDecodeError: ‘gbk‘ codec can‘t decode
- Keras import a custom metric model error: unknown metric function: Please ensure this object is passed to`custom_object‘
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX