Open WeishanLi opened 6 years ago
delete test.txt_annots.pkl
@lwslove911 did you find out any solution to this, I am facing the same issue here
please change r by 'rb' mode while reading that pckl file
https://github.com/endernewton/tf-faster-rcnn/issues/171
basically edit tf-faster-rcnn/lib/datasets/voc_eval.py line121, change 'b' to 'wb' so it will become
with open(cachefile,'wb') as f
After you do that, it may throw you a new EOF ran out of input error. You then need to edit same file line 105. Change it to
cachefile = os.path.join(cachedir, '%s_annots.pkl' % imagesetfile.split("/")[-1].split(".")[0])
Thanks @tensor-flower
Hi, did you fix it by the following? basically edit tf-faster-rcnn/lib/datasets/voc_eval.py line121, change 'b' to 'wb' so it will become with open(cachefile,'wb') as f After you do that, it may throw you a new EOF ran out of input error. You then need to edit same file line 105. Change it to cachefile = os.path.join(cachedir, '%s_annots.pkl' % imagesetfile.split("/")[-1].split(".")[0]) delete test.txt_annots.pkl
when i run ./experiments/scripts/test_faster_rcnn.sh 0 pascal_voc vgg16, i encountered the following error
Reading annotation for 4901/4952 Saving cached annotations to /home/xupt/awesome-tensorflow/tf-faster-rcnn/data/VOCdevkit2007/VOC2007/ImageSets/Main/test.txt_annots.pkl 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/xupt/awesome-tensorflow/tf-faster-rcnn/tools/../lib/model/test.py", line 192, in test_net imdb.evaluate_detections(all_boxes, output_dir) File "/home/xupt/awesome-tensorflow/tf-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 283, in evaluate_detections self._do_python_eval(output_dir) File "/home/xupt/awesome-tensorflow/tf-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 246, in _do_python_eval use_07_metric=use_07_metric, use_diff=self.config['use_diff']) File "/home/xupt/awesome-tensorflow/tf-faster-rcnn/tools/../lib/datasets/voc_eval.py", line 122, in voc_eval pickle.dump(recs, f) TypeError: write() argument must be str, not bytes Command exited with non-zero status 1