hey-yahei / GluonConverter

MXNet-Gluon model to Caffe (support SSD in gluoncv)
MIT License
9 stars 1 forks source link

对gluoncv有版本要求吗? #6

Open feixuetuba opened 4 years ago

feixuetuba commented 4 years ago

我想把gluoncv的ssd转成caffe的,但是报错了:

Traceback (most recent call last): File "convert.py", line 18, in text_net, binary_weights = convert_ssd_model(model, input_shape=(1,3,shape,shape), to_bgr=True) File "/home/zhoumian/programs/GluonConverter/convert/convert_ssd_model.py", line 144, in convert_ssd_model return convert_model(net, detection_out, input_shape=input_shape, to_bgr=to_bgr, merge_bn=merge_bn) File "/home/zhoumian/programs/GluonConverter/convert/convert_model.py", line 319, in convert_model caffe_net = convert_model_to_layers(net, syms, input_shape, softmax, to_bgr, merge_bn) File "/home/zhoumian/programs/GluonConverter/convert/convert_model.py", line 249, in convert_model_to_layers assert convert_fn is not None, f"unknown op: {op}" AssertionError: unknown op: broadcast_mul

我用的转换代码: import mxnet as mx import gluoncv as gcv from gluoncv.utils import export_block from gluoncv.model_zoo import get_model import gluoncv as gluon from convert import convert_ssd_model, save_model

shape=300 params="mx_models/ssd_300_vgg16_atrous_voc_best.params"

netname="ssd%d_vgg16_atrous_voc"%shape model = gcv.model_zoo.get_model(net_name,pretrained=False, pretrained_base=False) model.load_parameters(params) ctx = [mx.cpu()] model.collect_params().reset_ctx(ctx = ctx)

text_net, binary_weights = convert_ssd_model(model, input_shape=(1,3,shape,shape), to_bgr=True) save_model(text_net, binary_weights, prefix="caffe_model/ssd300_voc")

feixuetuba commented 4 years ago

运行环境:ubuintu16.04, python3.7.1, gluoncv0.5.0