1.报错信息
Traceback (most recent call last):
File "C:/Users/hbwhx/Desktop/GAN-RNN_Timeseries-imputation-master/main_train.py", line 120, in <module>
main()
File "C:/Users/hbwhx/Desktop/GAN-RNN_Timeseries-imputation-master/main_train.py", line 62, in main
Imputer = tf.keras.models.load_model(r'C:\Users\hbwhx\Desktop\GAN-RNN_Timeseries-imputation-master\saved_models\rebatch_1_00.h5').encode()
File "C:\develop\Anaconda3\envs\tf_2.1_py_3.6\lib\site-packages\tensorflow_core\python\keras\saving\save.py", line 146, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File "C:\develop\Anaconda3\envs\tf_2.1_py_3.6\lib\site-packages\tensorflow_core\python\keras\saving\hdf5_format.py", line 166, in load_model_from_hdf5
model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'
2.解决方法
2.1 降低h5py版本
pip3 install h5py==2.10.0
在此问题中,使用当前方法,报错信息消除。
参考链接:https://blog.csdn.net/weixin_45371989/article/details/109789132