Running
Workspace blob cls_score_w with shape (21, 2048) does not match weights file shape (81, 2048)
E.g.:
python tools/train_net.py --cfg /root/Detectron/tmp/e2e_faster_rcnn_R-50-C4_1x.yaml OUTPUT_DIR tmp/det
PYTHONPATH
environment variable: /root/anacondapython --version
output: 2.7You've probably set the NUM_CLASSES: 21 in your config file, whereas you weights file has 81 classes. One way to get around that is to just load it and delete the conflicting blobs.
import cPickle as pkl
with open('model.pkl', 'rb') as f:
wts = pkl.load(f)
for blob in wts['blobs'].keys():
if blob.startswith('cls_score_') or blob.startswith('bbox_pred_'):
del wts['blobs'][blob]
with open('new_model.pkl', 'wb') as f:
pkl.dump(wts, f)
Hope this helps.
thx have done it
You've probably set the NUM_CLASSES: 21 in your config file, whereas you weights file has 81 classes. One way to get around that is to just load it and delete the conflicting blobs.
import cPickle as pkl with open('model.pkl', 'rb') as f: wts = pkl.load(f) for blob in wts['blobs'].keys(): if blob.startswith('cls_score_') or blob.startswith('bbox_pred_'): del wts['blobs'][blob] with open('new_model.pkl', 'wb') as f: pkl.dump(wts, f)
Hope this helps.
In which file do I need to add this details
Most helpful comment
You've probably set the NUM_CLASSES: 21 in your config file, whereas you weights file has 81 classes. One way to get around that is to just load it and delete the conflicting blobs.
Hope this helps.