错误描述:
1、保存模型:model.save_weights(‘./model.h5’)
2、脚本重启
3、加载模型:model.load_weights(‘./model.h5’)
4、模型报错:ValueError: You are trying to load a weight file containing 12 layers into a model with 0 layers.
问题分析:
模型创建后还没有编译,一般是在模型加载前调用model.build(input_shape)