Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, None, 2), (None, 4420, 4)] #273

Open
fengyanWang opened this issue Jan 13, 2022 · 0 comments

Comments

@fengyanWang
Copy link

你好,我这边调用你的convert_tensorflow.py脚本,对工程中预训练模型进行转换,出现以下错误,log打出如下:
Traceback (most recent call last):
File "/home/wfy/project/python_project/face/ultra_face/tf/convert_tensorflow.py", line 37, in
main()
File "/home/wfy/project/python_project/face/ultra_face/tf/convert_tensorflow.py", line 23, in main
model = create_slim_net(input_shape, base_channel, num_classes)
File "/home/wfy/project/python_project/face/ultra_face/tf/model/slim_320.py", line 64, in create_slim_net
center_variance, size_variance)
File "/home/wfy/project/python_project/face/ultra_face/tf/backend/utils.py", line 22, in post_processing
result = tf.keras.layers.Concatenate(axis=-1)([cls, loc])
File "/home/wfy/.conda/envs/wfy_torch/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 538, in call
self._maybe_build(inputs)
File "/home/wfy/.conda/envs/wfy_torch/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1603, in _maybe_build
self.build(input_shapes)
File "/home/wfy/.conda/envs/wfy_torch/lib/python3.6/site-packages/tensorflow/python/keras/utils/tf_utils.py", line 151, in wrapper
output_shape = fn(instance, input_shape)
File "/home/wfy/.conda/envs/wfy_torch/lib/python3.6/site-packages/tensorflow/python/keras/layers/merge.py", line 392, in build
'Got inputs shapes: %s' % (input_shape))
ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, None, 2), (None, 4420, 4)]

使用的tf版本是1.13的,通过debug定位到是utils.py脚本中的result = tf.keras.layers.Concatenate(axis=-1)([cls, loc])出错

期盼解答,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant