Open lunar-r opened 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为空,具体还需您自己排查一下,我还没遇到这种情况。
好的,谢谢啦!
@mmcgg Hi 排查出来了吗?我遇到了同样的问题,也在排查中。
@mmcgg Hi,问题已解决,是部分图片会因为P网络检查不出来box,所以导致np.concatenate里的bbox_pred_list为空,典型图片是swimming的第一张,通过在MtcnnDetector.detect_face方法里加入异常处理可以解决。
Hi, @Zepyhrus,在MtcnnDetector.detect_face方法里加入异常处理具体在哪行进行条件语句的修改,新手求问望解答。谢谢
@ss24cs 异常处理跳过那几张异常图片就好了
try:
# ... your code ...
except:
pass
在MtcnnDetector.detect_face方法里加入异常处理具体在哪行进行条件语句的修改?????能k看哈代码吗?
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
请问一下这是什么报错?谢谢。