LeslieZhoa / tensorflow-MTCNN

人脸检测MTCNN算法,采用tensorflow框架编写,从理解到训练,中文注释完全,含测试和训练,支持摄像头
364 stars 141 forks source link

o_net hard_example报错 #13

Open lunar-r opened 5 years ago

lunar-r commented 5 years ago

lunar@lunar-virtual-machine:~/PycharmProjects/tensorflow_mtcnn/preprocess$ python gen_hard_example.py 24 2019-05-12 09:33:06.690596: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 载入数据 8247it [2:47:10, 1.26it/s]Traceback (most recent call last): File "gen_hard_example.py", line 193, in main(parse_arguments(sys.argv[1:])) File "gen_hardexample.py", line 70, in main detectors,=mtcnn_detector.detect_face(test_data) File "../detection/MtcnnDetector.py", line 87, in detect_face boxes, boxes_c, landmark = self.detect_rnet(im, boxes_c) File "../detection/MtcnnDetector.py", line 181, in detect_rnet clsscores, reg, = self.rnet_detector.predict(cropped_ims) File "../detection/detector.py", line 63, in predict return np.concatenate(cls_prob_list, axis=0), np.concatenate(bbox_pred_list, axis=0), np.concatenate(landmark_pred_list, axis=0) ValueError: need at least one array to concatenate

请问一下这是什么报错?谢谢。

LeslieZhoa commented 5 years ago

Hi @mmcgg 从问题上看可能是detector.py里的return np.concatenate(cls_prob_list, axis=0), np.concatenate(bbox_pred_list, axis=0), np.concatenate(landmark_pred_list, axis=0)过程中某一tensor为空,具体还需您自己排查一下,我还没遇到这种情况。

lunar-r commented 5 years ago

好的,谢谢啦!

Zepyhrus commented 5 years ago

@mmcgg Hi 排查出来了吗?我遇到了同样的问题,也在排查中。

Zepyhrus commented 5 years ago

@mmcgg Hi,问题已解决,是部分图片会因为P网络检查不出来box,所以导致np.concatenate里的bbox_pred_list为空,典型图片是swimming的第一张,通过在MtcnnDetector.detect_face方法里加入异常处理可以解决。

ss24cs commented 4 years ago

Hi, @Zepyhrus,在MtcnnDetector.detect_face方法里加入异常处理具体在哪行进行条件语句的修改,新手求问望解答。谢谢

Zepyhrus commented 4 years ago

@ss24cs 异常处理跳过那几张异常图片就好了

try:
   # ... your code ... 
except:
  pass
SHDPC commented 2 years ago

在MtcnnDetector.detect_face方法里加入异常处理具体在哪行进行条件语句的修改?????能k看哈代码吗?