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
相关文章推荐
- tensorflow报错:Shape must be rank 2 but is rank 3 for 'MatMul' (op: 'MatMul')
- tensorflow报错:Shape must be rank 2 but is rank 3 for 'MatMul' (op: 'MatMul')
- ValueError: Shape must be rank 0 but is rank 1 for 'train_data/ReadFile' (op: 'ReadFile') with input
- MPI编译C++程序出现#error "SEEK_SET is #defined but must not be for the C++ binding of MPI" 的解决方法
- MPI编译C++程序出现#error "SEEK_SET is #defined but must not be for the C++ binding of MPI" 的解决方法
- Matlab中两个矩阵相乘报错:MTIMES is not fully supported for integer classes. At least one input must be scalar
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for elemen
- According to TLD, tag bean:write must be empty, but is not
- 转:使用Maven创建多module工程时,子module的pom文件报 must be "pom" but is "jar" 错误。
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
- struts标签相关错误:According to TLD, tag bean:write must be empty, but is not
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
- vc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
- According to TLD, tag fmt:formatDate must be empty, but is not 问题的解决
- 异常:According to TLD tag beanwrite must be empty but is not
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
- xml报错“cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element”