dmlc/gluon-cv

How to use a trained params to predict?

Open

#229 ouverte le 2 août 2018

Voir sur GitHub
 (9 commentaires) (0 réactions) (0 assignés)Python (1 224 forks)batch import
good first issuequestion

Métriques du dépôt

Stars
 (5 610 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Hi. I am a new one here. It is a awesome lib for CV, thanks for your great work. Now, I am encountering a problem that I trained ssd_300_vgg16_atrous_voc on my own dataset, the dataset has 4 classes. After training, I got a "ssd_300_vgg16_atrous_voc_best.params" file. When I want to load the parmeters and predict on new images, it return an error, logs as it, AssertionError: Failed loading Parameter 'ssd0_convpredictor4_conv0_weight' from saved params: shape incompatible expected (126, 0, 3, 3) vs saved (30, 512, 3, 3) The command I used as follow, from gluoncv import model_zoo, data, utils from matplotlib import pyplot as plt import mxnet as mx ctx = [mx.cpu()] net = model_zoo.get_model('ssd_300_vgg16_atrous_voc', pretrained=False) net.load_parameters('ssd_300_vgg16_atrous_voc_best.params', ctx = ctx)

Thanks for any help.

Guide contributeur