Does Any one got “AttributeError: 'str' object has no attribute 'decode' ” , while Loading a Keras Saved Model

后端 未结 5 1882
轮回少年
轮回少年 2021-01-01 17:01

After Training, I saved Both Keras whole Model and Only Weights using

model.save_weights(MODEL_WEIGHTS) and model.save(MODEL_NAME)

Models

5条回答
  •  情歌与酒
    2021-01-01 17:40

    This is probably due to a model saved from a different version of keras. I got the same problem when loading a model generated by tensorflow.keras (which is similar to keras 2.1.6 for tf 1.12 I think) from keras 2.2.6.

    You can load the weights with model.load_weights and resave the complete model from the keras version you want to use.

提交回复
热议问题