endernewton / tf-faster-rcnn

Tensorflow Faster RCNN for Object Detection
https://arxiv.org/pdf/1702.02138.pdf
MIT License
3.65k stars 1.57k forks source link

ValueError: not enough values to unpack (expected 3, got 0) #421

Open hanlaoshi opened 5 years ago

hanlaoshi commented 5 years ago

Traceback (most recent call last): File "./tools/test_net.py", line 120, in test_net(sess, net, imdb, filename, max_per_image=args.max_per_image) File "/home/rcvms/project/tf-faster-rcnn-master/tf-faster-rcnn-master/tools/../lib/model/test.py", line 192, in test_net imdb.evaluate_detections(all_boxes, output_dir) File "/home/rcvms/project/tf-faster-rcnn-master/tf-faster-rcnn-master/tools/../lib/datasets/pascal_voc.py", line 283, in evaluate_detections self._do_python_eval(output_dir) File "/home/rcvms/project/tf-faster-rcnn-master/tf-faster-rcnn-master/tools/../lib/datasets/pascal_voc.py", line 246, in _do_python_eval use_07_metric=use_07_metric, use_diff=self.config['use_diff']) ValueError: not enough values to unpack (expected 3, got 0) 1163.25user 501.04system 34:54.72elapsed 79%CPU (0avgtext+0avgdata 2001428maxresident)k 0inputs+62712outputs (1major+573112minor)pagefaults 0swaps

I need help ! First, i got a error with" EOFError: Ran out of input"when i run the test_faster_rcnn.sh ,and this solution "EOFError: Ran out of input #171" doesn't work for me ! so ,i tried this solution "https://stackoverflow.com/questions/24791987/why-do-i-get-pickle-eoferror-ran-out-of-input-reading-an-empty-file " , just like this try: with open(cachefile, 'wb') as f: pickle.dump(recs, f) except EOFError: return {} else:

load

try:
  with open(cachefile, 'rb') as f:
    try:
      recs = pickle.load(f)
    except:
      recs = pickle.load(f, encoding='bytes')
except EOFError:
  return{}

This issues " EOFError: Ran out of input" is disppear, but another issues happen "ValueError: not enough values to unpack (expected 3, got 0)". If everyone can help me, I will be very grateful.

hanlaoshi commented 5 years ago

Ok, The problem is solved, just modify the voc_eval.py code, line 107, cachefile = os.path.join(cachedir, '%s_annots.pkl' % imagesetfile) to cachefile = os.path.join(cachedir, ('%s_annots.pkl' % 'imagesetfile'))