我使用了这里的示例代码:https://github.com/fchollet/keras/issues/2295
在keras中训练模型后,我无法加载模型。我收到以下错误信息:
ValueError: Optimizer weight shape (3, 3, 512, 512) not compatible with provided weight shape (256, 43)
我尝试使用HDFView删除优化器权重并重新加载,但是我会收到以下错误:ValueError: ('shapes (10,4224) and (1128,256) not aligned: 4224 (dim 1) != 1128 (dim 0)', (10, 4224), (1128, 256))
Apply node that caused the error: Dot22(Reshape{2}.0, lstm_2_W_i)
Toposort index: 249
Inputs types: [TensorType(float32, matrix), TensorType(float32, matrix)]
Inputs shapes: [(10, 4224), (1128, 256)]
Inputs strides: [(16896, 4), (1024, 4)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[Elemwise{Add}[(0, 0)](Dot22.0, InplaceDimShuffle{x,0}.0)]]
我也尝试将架构保存为JSON并分别保存权重,然后进行加载,但即使这样也会失败。