weixin_39821378
weixin_39821378
2021-01-09 07:52

Error:run ./experiments/scripts/test_faster_rcnn.sh 0 pascal_voc vgg16

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

该提问来源于开源项目:endernewton/tf-faster-rcnn

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39605345 weixin_39605345 4月前

    delete test.txt_annots.pkl

    点赞 评论 复制链接分享
  • weixin_39779032 weixin_39779032 4月前

    did you find out any solution to this, I am facing the same issue here

    点赞 评论 复制链接分享
  • weixin_39673037 weixin_39673037 4月前

    please change r by 'rb' mode while reading that pckl file

    点赞 评论 复制链接分享
  • weixin_39820437 weixin_39820437 4月前

    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])
    
    点赞 评论 复制链接分享
  • weixin_39964833 weixin_39964833 4月前

    Thanks -flower

    点赞 评论 复制链接分享
  • weixin_39647180 weixin_39647180 4月前

    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

    点赞 评论 复制链接分享

相关推荐