qfgaohao/pytorch-ssd

RuntimeError: Error(s) in loading state_dict for SSD:

Opened this issue · 0 comments

I tried to train the raccoon dataset using the pytorch-ssd project. There is only one class in that raccoon dataset, train_ssd.py program's parameter are simply trained with mb1-ssd and so have only '--datasets data/raccon_dataset'

Screenshot from 2021-03-16 12-26-05
Screenshot from 2021-03-16 12-27-52

However, when I tried to make an evaluation with trained model, I had the same problem as above. The parameters of eval_ssd.py are as follows: --net mb1-ssd --dataset data/raccoon_dataset --trained_model models/mb1-ssd-Epoch-29-Loss-2.82726310599934.pth --label_file data/raccoon_dataset/labels.txt

But I finally solved the problem, and found the data label was one raccoonn in program, and I added background to it, and I am wondering if it's right or the underlying cause.

# eval_ssd.py: line 128
class_names = [name.strip() for name in open(args.label_file).readlines()]
class_names.insert(0, 'background')