tensorflow-MTCNN icon indicating copy to clipboard operation
tensorflow-MTCNN copied to clipboard

o_net hard_example报错

Open lunar-r opened this issue 6 years ago • 7 comments

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_hard_example.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 cls_scores, 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

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

lunar-r avatar May 12 '19 06:05 lunar-r

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为空,具体还需您自己排查一下,我还没遇到这种情况。

LeslieZhoa avatar May 12 '19 14:05 LeslieZhoa

好的,谢谢啦!

lunar-r avatar May 13 '19 02:05 lunar-r

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

Zepyhrus avatar Jun 11 '19 01:06 Zepyhrus

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

Zepyhrus avatar Jun 11 '19 12:06 Zepyhrus

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

ss24cs avatar Dec 26 '19 01:12 ss24cs

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

try:
   # ... your code ... 
except:
  pass

Zepyhrus avatar Jan 06 '20 01:01 Zepyhrus

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

HaodeShi avatar Jul 23 '22 09:07 HaodeShi