【发布时间】:2017-02-19 13:51:27
【问题描述】:
我在这里使用了示例代码: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 并分别保存权重然后加载,但即使这样也失败了。
【问题讨论】:
标签: python deep-learning keras