faster-rcnnモデルのテスト中にFileNotFoundError:[Errno 2]No such file or directory:
17504 ワード
オペレーティングシステム:ubuntu 16.04 Python3.7.6 tensorflow-1.13.1 -gpu
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/heisenberg/tf-faster-rcnn/data/VOCdevkit2007/results/VOC2007/Main/※※※.txt’
問題の説明
質問のプレビュー
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/heisenberg/tf-faster-rcnn/data/VOCdevkit2007/results/VOC2007/Main/※※※.txt’
問題の説明
アルプスと北冥に続いて楊其名は超運行faster-rcnnと呼ばれている.
にあるhttps://github.com/endernewton/tf-faster-rcnnのDemo and Test with pre-trained modelsの段階で、resnet 101モデルの前処理をテストするときに実行します.GPU_ID=0
./experiments/scripts/test_faster_rcnn.sh $GPU_ID pascal_voc_0712 res101
私のパソコンには次のような結果が出ました....
...
...
im_detect: 4950/4952 0.949s 0.012s
im_detect: 4951/4952 0.949s 0.012s
im_detect: 4952/4952 0.949s 0.012s
Evaluating detections
Writing aeroplane VOC results file
Traceback (most recent call last):
File "./tools/test_net.py", line 120, in <module>
test_net(sess, net, imdb, filename, max_per_image=args.max_per_image)
File "/home/heisenberg/tf-faster-rcnn/tools/../lib/model/test.py", line 192, in test_net
imdb.evaluate_detections(all_boxes, output_dir)
File "/home/heisenberg/tf-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 282, in evaluate_detections
self._write_voc_results_file(all_boxes)
File "/home/heisenberg/tf-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 209, in _write_voc_results_file
with open(filename, 'wt') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/heisenberg/tf-faster-rcnn/data/VOCdevkit2007/results/VOC2007/Main/comp4_0a66c815-766d-42a9-be32-d6c36dff6678_det_test_aeroplane.txt'
Command exited with non-zero status 1
2927.98user 821.72system 1:19:52elapsed 78%CPU (0avgtext+0avgdata 2285112maxresident)k
861248inputs+28160outputs (6major+513405minor)pagefaults 0swaps
の原因となる
ディレクトリが見つかりません.ディレクトリ/home/heisenberg(私のユーザー名)/tf-faster-rcnn/data/VOCdevkit 2007/results/VOC 2007/Mainを新規作成するだけです.
解決策
cd /home/heisenberg/tf-faster-rcnn/data/VOCdevkit2007 #
mkdir -p results/VOC2007/Main #
結果は次のとおりです.Saving cached annotations to /home/heisenberg/tf-faster-rcnn/data/VOCdevkit2007/annotations_cache/test_annots.pkl
AP for aeroplane = 0.8305
AP for bicycle = 0.8701
AP for bird = 0.8139
AP for boat = 0.7415
AP for bottle = 0.6851
AP for bus = 0.8764
AP for car = 0.8810
AP for cat = 0.8832
AP for chair = 0.6235
AP for cow = 0.8679
AP for diningtable = 0.7061
AP for dog = 0.8855
AP for horse = 0.8731
AP for motorbike = 0.8299
AP for person = 0.8270
AP for pottedplant = 0.5310
AP for sheep = 0.8114
AP for sofa = 0.7752
AP for train = 0.8466
AP for tvmonitor = 0.7936
Mean AP = 0.7976
~~~~~~~~
Results:
0.830
0.870
0.814
0.742
0.685
0.876
0.881
0.883
0.623
0.868
0.706
0.886
0.873
0.830
0.827
0.531
0.811
0.775
0.847
0.794
0.798
~~~~~~~~
--------------------------------------------------------------
Results computed with the **unofficial** Python eval code.
Results should be very close to the official MATLAB eval code.
Recompute with `./tools/reval.py --matlab ...` for your paper.
-- Thanks, The Management
--------------------------------------------------------------
2915.43user 774.14system 1:19:42elapsed 77%CPU (0avgtext+0avgdata 2297296maxresident)k
710128inputs+80728outputs (5major+625915minor)pagefaults 0swaps
GPU_ID=0
./experiments/scripts/test_faster_rcnn.sh $GPU_ID pascal_voc_0712 res101
...
...
...
im_detect: 4950/4952 0.949s 0.012s
im_detect: 4951/4952 0.949s 0.012s
im_detect: 4952/4952 0.949s 0.012s
Evaluating detections
Writing aeroplane VOC results file
Traceback (most recent call last):
File "./tools/test_net.py", line 120, in <module>
test_net(sess, net, imdb, filename, max_per_image=args.max_per_image)
File "/home/heisenberg/tf-faster-rcnn/tools/../lib/model/test.py", line 192, in test_net
imdb.evaluate_detections(all_boxes, output_dir)
File "/home/heisenberg/tf-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 282, in evaluate_detections
self._write_voc_results_file(all_boxes)
File "/home/heisenberg/tf-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 209, in _write_voc_results_file
with open(filename, 'wt') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/heisenberg/tf-faster-rcnn/data/VOCdevkit2007/results/VOC2007/Main/comp4_0a66c815-766d-42a9-be32-d6c36dff6678_det_test_aeroplane.txt'
Command exited with non-zero status 1
2927.98user 821.72system 1:19:52elapsed 78%CPU (0avgtext+0avgdata 2285112maxresident)k
861248inputs+28160outputs (6major+513405minor)pagefaults 0swaps
cd /home/heisenberg/tf-faster-rcnn/data/VOCdevkit2007 #
mkdir -p results/VOC2007/Main #
Saving cached annotations to /home/heisenberg/tf-faster-rcnn/data/VOCdevkit2007/annotations_cache/test_annots.pkl
AP for aeroplane = 0.8305
AP for bicycle = 0.8701
AP for bird = 0.8139
AP for boat = 0.7415
AP for bottle = 0.6851
AP for bus = 0.8764
AP for car = 0.8810
AP for cat = 0.8832
AP for chair = 0.6235
AP for cow = 0.8679
AP for diningtable = 0.7061
AP for dog = 0.8855
AP for horse = 0.8731
AP for motorbike = 0.8299
AP for person = 0.8270
AP for pottedplant = 0.5310
AP for sheep = 0.8114
AP for sofa = 0.7752
AP for train = 0.8466
AP for tvmonitor = 0.7936
Mean AP = 0.7976
~~~~~~~~
Results:
0.830
0.870
0.814
0.742
0.685
0.876
0.881
0.883
0.623
0.868
0.706
0.886
0.873
0.830
0.827
0.531
0.811
0.775
0.847
0.794
0.798
~~~~~~~~
--------------------------------------------------------------
Results computed with the **unofficial** Python eval code.
Results should be very close to the official MATLAB eval code.
Recompute with `./tools/reval.py --matlab ...` for your paper.
-- Thanks, The Management
--------------------------------------------------------------
2915.43user 774.14system 1:19:42elapsed 77%CPU (0avgtext+0avgdata 2297296maxresident)k
710128inputs+80728outputs (5major+625915minor)pagefaults 0swaps