smallcorgi / Faster-RCNN_TF

Faster-RCNN in Tensorflow
MIT License
2.34k stars 1.12k forks source link

KeyError: '001009' when i run test_net.py after i have trained my own dataset #334

Open Dre2mspace opened 5 years ago

Dre2mspace commented 5 years ago

voc_2007_train voc_2007_val voc_2007_trainval voc_2007_test kitti_train kitti_val kitti_trainval kitti_test nthu_71 nthu_370 Called with args: Namespace(cfg_file='experiments/cfgs/faster_rcnn_end2end.yml', comp_mode=False, device='gpu', device_id=0, imdb_name='voc_2007_test', model='/data/Hogwarts/Faster-RCNN_TF/output/faster_rcnn_end2end/voc_2007_trainval/VGGnet_fast_rcnn_iter_70000.ckpt', network_name='VGGnet_test', prototxt=None, wait=True) /data/Hogwarts/Faster-RCNN_TF/tools/../lib/fast_rcnn/config.py:294: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. yaml_cfg = edict(yaml.load(f)) Using config: {'DATA_DIR': '/data/Hogwarts/Faster-RCNN_TF/data', 'DEDUP_BOXES': 0.0625, 'EPS': 1e-14, 'EXP_DIR': 'faster_rcnn_end2end', 'GPU_ID': 0, 'IS_MULTISCALE': False, 'MATLAB': 'matlab', 'MODELS_DIR': '/data/Hogwarts/Faster-RCNN_TF/models/pascal_voc', 'PIXEL_MEANS': array([[[102.9801, 115.9465, 122.7717]]]), 'RNG_SEED': 3, 'ROOT_DIR': '/data/Hogwarts/Faster-RCNN_TF', 'TEST': {'BBOX_REG': True, 'DEBUG_TIMELINE': False, 'HAS_RPN': True, 'MAX_SIZE': 1000, 'NMS': 0.3, 'PROPOSAL_METHOD': 'selective_search', 'RPN_MIN_SIZE': 16, 'RPN_NMS_THRESH': 0.7, 'RPN_POST_NMS_TOP_N': 300, 'RPN_PRE_NMS_TOP_N': 6000, 'SCALES': [600], 'SVM': False}, 'TRAIN': {'ASPECT_GROUPING': True, 'BATCH_SIZE': 128, 'BBOX_INSIDE_WEIGHTS': [1.0, 1.0, 1.0, 1.0], 'BBOX_NORMALIZE_MEANS': [0.0, 0.0, 0.0, 0.0], 'BBOX_NORMALIZE_STDS': [0.1, 0.1, 0.2, 0.2], 'BBOX_NORMALIZE_TARGETS': True, 'BBOX_NORMALIZE_TARGETS_PRECOMPUTED': True, 'BBOX_REG': True, 'BBOX_THRESH': 0.5, 'BG_THRESH_HI': 0.5, 'BG_THRESH_LO': 0.0, 'DEBUG_TIMELINE': False, 'DISPLAY': 10, 'FG_FRACTION': 0.25, 'FG_THRESH': 0.5, 'GAMMA': 0.1, 'HAS_RPN': True, 'IMS_PER_BATCH': 1, 'LEARNING_RATE': 0.001, 'MAX_SIZE': 1000, 'MOMENTUM': 0.9, 'PROPOSAL_METHOD': 'gt', 'RPN_BATCHSIZE': 256, 'RPN_BBOX_INSIDE_WEIGHTS': [1.0, 1.0, 1.0, 1.0], 'RPN_CLOBBER_POSITIVES': False, 'RPN_FG_FRACTION': 0.5, 'RPN_MIN_SIZE': 16, 'RPN_NEGATIVE_OVERLAP': 0.3, 'RPN_NMS_THRESH': 0.7, 'RPN_POSITIVE_OVERLAP': 0.7, 'RPN_POSITIVE_WEIGHT': -1.0, 'RPN_POST_NMS_TOP_N': 2000, 'RPN_PRE_NMS_TOP_N': 12000, 'SCALES': [600], 'SNAPSHOT_INFIX': '', 'SNAPSHOT_ITERS': 5000, 'SNAPSHOT_PREFIX': 'VGGnet_fast_rcnn', 'STEPSIZE': 50000, 'USE_FLIPPED': True, 'USE_PREFETCH': False}, 'USE_GPU_NMS': True} <bound method pascal_voc.default_roidb of <datasets.pascal_voc.pascal_voc object at 0x7fa487b77f10>> /gpu:0 Tensor("Placeholder:0", shape=(?, ?, ?, 3), dtype=float32) Tensor("conv5_3/conv5_3:0", shape=(?, ?, ?, 512), dtype=float32) Tensor("rpn_conv/3x3/rpn_conv/3x3:0", shape=(?, ?, ?, 512), dtype=float32) Tensor("rpn_cls_score/rpn_cls_score:0", shape=(?, ?, ?, 18), dtype=float32) Tensor("rpn_cls_prob:0", shape=(?, ?, ?, ?), dtype=float32) Tensor("rpn_cls_prob_reshape:0", shape=(?, ?, ?, 18), dtype=float32) Tensor("rpn_bbox_pred/rpn_bbox_pred:0", shape=(?, ?, ?, 36), dtype=float32) Tensor("Placeholder_1:0", shape=(?, 3), dtype=float32) Tensor("conv5_3/conv5_3:0", shape=(?, ?, ?, 512), dtype=float32) Tensor("rois:0", shape=(?, 5), dtype=float32) [<tf.Tensor 'conv5_3/conv5_3:0' shape=(?, ?, ?, 512) dtype=float32>, <tf.Tensor 'rois:0' shape=(?, 5) dtype=float32>] Tensor("fc7/fc7:0", shape=(?, 4096), dtype=float32) Use network VGGnet_test in training 2019-05-06 20:15:14.338942: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA 2019-05-06 20:15:14.505625: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties: name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582 pciBusID: 0000:02:00.0 totalMemory: 11.90GiB freeMemory: 11.57GiB 2019-05-06 20:15:14.505660: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: TITAN Xp, pci bus id: 0000:02:00.0, compute capability: 6.1) Loading model weights from /data/Hogwarts/Faster-RCNN_TF/output/faster_rcnn_end2end/voc_2007_trainval/VGGnet_fast_rcnn_iter_70000.ckpt im_detect: 1/22 1.101s 0.000s im_detect: 2/22 0.674s 0.000s im_detect: 3/22 0.531s 0.000s im_detect: 4/22 0.470s 0.000s im_detect: 5/22 0.430s 0.000s im_detect: 6/22 0.385s 0.000s im_detect: 7/22 0.368s 0.000s im_detect: 8/22 0.356s 0.000s im_detect: 9/22 0.348s 0.000s im_detect: 10/22 0.340s 0.000s im_detect: 11/22 0.332s 0.000s im_detect: 12/22 0.323s 0.000s im_detect: 13/22 0.310s 0.000s im_detect: 14/22 0.303s 0.000s im_detect: 15/22 0.293s 0.000s im_detect: 16/22 0.294s 0.000s im_detect: 17/22 0.293s 0.000s im_detect: 18/22 0.281s 0.000s im_detect: 19/22 0.281s 0.000s im_detect: 20/22 0.272s 0.000s im_detect: 21/22 0.273s 0.000s im_detect: 22/22 0.272s 0.000s Evaluating detections Writing person VOC results file Writing traffic police VOC results file Writing cyclist VOC results file VOC07 metric? Yes Traceback (most recent call last): File "./tools/test_net.py", line 107, in test_net(sess, network, imdb, weights_filename) File "/data/Hogwarts/Faster-RCNN_TF/tools/../lib/fast_rcnn/test.py", line 345, in test_net imdb.evaluate_detections(all_boxes, output_dir) File "/data/Hogwarts/Faster-RCNN_TF/tools/../lib/datasets/pascal_voc.py", line 330, in evaluate_detections self._do_python_eval(output_dir) File "/data/Hogwarts/Faster-RCNN_TF/tools/../lib/datasets/pascal_voc.py", line 293, in _do_python_eval use_07_metric=use_07_metric) File "/data/Hogwarts/Faster-RCNN_TF/tools/../lib/datasets/voc_eval.py", line 126, in voc_eval R = [obj for obj in recs[imagename] if obj['name'] == classname] KeyError: '001009'

above is output and i have three classes。 how can i solve this problem?

Dre2mspace commented 5 years ago

i hava solve it by delete data/VOCdekit2007/annotations_cache :)