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
我想把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")