tf-faster-rcnn
tf-faster-rcnn copied to clipboard
TypeError: write() argument must be str, not bytes
File "/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 "/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 2484.50user 101.77system 7:44.19elapsed 557%CPU (0avgtext+0avgdata 2846360maxresident)k 1296inputs+62952outputs (4major+7864686minor)pagefaults 0swaps
./experiments/scripts/test_faster_rcnn.sh $GPU_ID pascal_voc_0712 res101
Hi, @henbucuoshanghai
You can probably solve this error and another error coused by changing as follows:
Edit tf-faster-rcnn/lib/datasets/voc_eval.py
line121, change 'w' to 'wb' like this
with open(cachefile, 'wb') as f:
line105, change to
cachefile = os.path.join(cachedir, '%s_annots.pkl' % imagesetfile.split("/")[-1].split(".")[0])
@henbucuoshanghai Is 'cachefile' defined correctly? Can you show me your code?