您的位置:首页 > 其它

180211 Keras矩阵乘法MatMul报错 Shape must be rank 2 but is rank 3 for 'MatMul'

2018-02-11 11:30 741 查看
ValueError: Shape must be rank 2 but is rank 3 for 'MatMul_10' (op: 'MatMul') with input shapes: [?,10,10], [?,10].


原因1:Keras后端tensorflow与theano的矩阵乘法定义不同,切换后端即可

Switching from one backend to another

TensorFlow学习笔记–matmul和multiply两种乘法的区别

keras配置TensorFlow_or_theano

原因2:矩阵乘法没有按照定义来,需要根据定义修改代码

http://blog.csdn.net/u011961856/article/details/77336205

http://blog.csdn.net/blythe0107/article/details/74171870
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐