Linzaer / Ultra-Light-Fast-Generic-Face-Detector-1MB

💎1MB lightweight face detection model (1MB轻量级人脸检测模型)
MIT License
7.17k stars 1.54k forks source link

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 2 years ago

fengyanWang commented 2 years ago

你好,我这边调用你的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])出错

期盼解答,谢谢!