Hi @iamhankai. When I ran your code I got the following error:
File "/home/t0c01zx/anaconda3/envs/keras/lib/python3.6/site-packages/keras/engine/topology.py", line 1409, in call
output = K.batch_dot(l1, l2, self.dot_axes)
File "/home/t0c01zx/anaconda3/envs/keras/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 884, in batch_dot
out = tf.matmul(x, y, adjoint_a=adj_x, adjoint_b=adj_y)
File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 2455, in matmul
a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 5333, in mat_mul
name=name)
File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1823, in init
control_input_ops)
File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1662, in _create_c_op
raise ValueError(str(e))
ValueError: Shape must be rank 2 but is rank 3 for 'MatMul_29' (op: 'MatMul') with input shapes: [?,196,512], [?,512].
I was using Keras 1.2.1 and Tensorflow 1.13.0. The model I choose is ResNet50.
Hi @iamhankai. When I ran your code I got the following error:
File "/home/t0c01zx/anaconda3/envs/keras/lib/python3.6/site-packages/keras/engine/topology.py", line 1409, in call output = K.batch_dot(l1, l2, self.dot_axes) File "/home/t0c01zx/anaconda3/envs/keras/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 884, in batch_dot out = tf.matmul(x, y, adjoint_a=adj_x, adjoint_b=adj_y) File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 2455, in matmul a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name) File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 5333, in mat_mul name=name) File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op op_def=op_def) File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1823, in init control_input_ops) File "/home/t0c01zx/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1662, in _create_c_op raise ValueError(str(e)) ValueError: Shape must be rank 2 but is rank 3 for 'MatMul_29' (op: 'MatMul') with input shapes: [?,196,512], [?,512].
I was using Keras 1.2.1 and Tensorflow 1.13.0. The model I choose is ResNet50.
Looking forward to your reply!