提交 4e1d65ec 编写于 作者: xiebaiyuan's avatar xiebaiyuan

update script for mdl mobilenet convert

上级 d8d85507
...@@ -78,26 +78,30 @@ class Converter: ...@@ -78,26 +78,30 @@ class Converter:
layers_ = self.mdl_json['layer'] layers_ = self.mdl_json['layer']
for layer in layers_: for layer in layers_:
desc_ops_add = block_desc.ops.add()
# print layer if layer['type'] == 'SoftmaxLayer':
# for i in layer: pass
# print i else:
if 'name' in layer: desc_ops_add = block_desc.ops.add()
l_name = layer['name']
if 'type' in layer:
self.package_ops_type(desc_ops_add, layer)
if 'weight' in layer: # print layer
self.package_ops_weight2inputs(desc_ops_add, layer) # for i in layer:
# print i
if 'name' in layer:
l_name = layer['name']
if 'type' in layer:
self.package_ops_type(desc_ops_add, layer)
if 'output' in layer: if 'weight' in layer:
self.package_ops_outputs(desc_ops_add, layer) self.package_ops_weight2inputs(desc_ops_add, layer)
if 'input' in layer: if 'output' in layer:
self.package_ops_inputs(desc_ops_add, layer) self.package_ops_outputs(desc_ops_add, layer)
self.package_ops_attrs(desc_ops_add, layer) if 'input' in layer:
self.package_ops_inputs(desc_ops_add, layer)
self.package_ops_attrs(desc_ops_add, layer)
self.add_op_fetch(block_desc) self.add_op_fetch(block_desc)
...@@ -121,7 +125,7 @@ class Converter: ...@@ -121,7 +125,7 @@ class Converter:
inputs_add = desc_ops_add.inputs.add() inputs_add = desc_ops_add.inputs.add()
inputs_add.parameter = 'X' inputs_add.parameter = 'X'
# todo pick last layer --> op output # todo pick last layer --> op output
inputs_add.arguments.append('Softmax') inputs_add.arguments.append('fc7')
desc_ops_add.type = 'fetch' desc_ops_add.type = 'fetch'
outputs_add = desc_ops_add.outputs.add() outputs_add = desc_ops_add.outputs.add()
outputs_add.parameter = 'Out' outputs_add.parameter = 'Out'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册