我在Keras-0.3.3中有一个预训练的模型。它另存为json_file和weights文件。如果我尝试将其加载到最新的keras中,它将失败。如何将模型移植到最新的keras版本?
PS:我指的是这个github page
中的模型编辑1 :添加代码和错误
import os
os.environ['KERAS_BACKEND'] = 'theano'
from keras import backend
from keras.models import Sequential, model_from_json
model_path = Path('../Data/C3D/sports_1M.json')
weights_path = Path('../Data/C3D/sports1M_weights.h5')
c3d_model = model_from_json(open(model_path.as_posix(), 'r').read())
print(c3d_model.summary())
错误如下所示
ValueError: Improper config format: {'name': 'Sequential', 'layers': [{'input_shape': [3, 16, 112, 112], 'activation': 'relu' ...