dmlc/gluon-cv

How to use a trained params to predict?

Open

#229 建立於 2018年8月2日

在 GitHub 查看
 (9 留言) (0 反應) (0 負責人)Python (1,224 fork)batch import
good first issuequestion

倉庫指標

Star
 (5,610 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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.

貢獻者指南