代码链接:https://github.com/endernewton/tf-faster-rcnn
(1)TypeError: write() argument must be str, not bytes:
lib / datasets / voc_eval.py 第105行改为
cachefile = os.path.join(cachedir, '%s_annots.pkl' % imagesetfile.split("/")[-1].split(".")[0])
第121行修改为
with open(cachefile, 'wb') as f:
(2)InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [4096,21] rhs shape= [4096,3]
tools/demo.py 第141行中的21改为自己数据集的(类别数+1),比如类别数为10,就改为
net.create_architecture("TEST", 11, tag='default', anchor_scales=[8, 16, 32])
(3)This application failed to start because it could not find or load the Qt platform plugin "xcb"
安装pyqt库:conda install pyqt
(4)ImportError: No module named pycocotools.coco
如果数据集制作成voc格式的话,就在代码中注释掉pycocotools。在/lib/datasets/coco.py 的23~25行:
#from pycocotools.coco import COCO
#from pycocotools.cocoeval import COCOeval
#from pycocotools import mask as COCOmask
(5)TypeError: load() got an unexpected keyword argument 'encoding'
训练前删除data/cache ; 测试前删除 data/VOCdevkit2007/annotations_cache