[MO] Fix EfficientDet conversion (#5029)

This commit is contained in:
Dmitry Kurtaev 2021-03-30 12:28:18 +03:00 committed by GitHub
parent b4a2ac9d1c
commit a2a7320d74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -22,6 +22,7 @@ from mo.ops.result import Result
class EfficientDet(FrontReplacementFromConfigFileGeneral):
replacement_id = 'AutomlEfficientDet'
run_not_recursively = True
def run_before(self):
from extensions.front.ExpandDimsToUnsqueeze import ExpandDimsToUnsqueeze
@ -57,10 +58,11 @@ class EfficientDet(FrontReplacementFromConfigFileGeneral):
# which includes padding and resizing from the model
preprocessing_input_node_id = replacement_descriptions['preprocessing_input_node']
assert preprocessing_input_node_id in graph.nodes, 'The node with name "{}" is not found in the graph. This ' \
'node should provide scaled image output and is specified' \
'should be a last node before image normalization and is specified' \
' in the json file.'.format(preprocessing_input_node_id)
preprocessing_input_node = Node(graph, preprocessing_input_node_id)
preprocessing_input_node.in_port(0).get_connection().set_source(parameter_node.out_port(0))
consumer_node = preprocessing_input_node.out_port(0).get_connection().get_destination().node
consumer_node.in_port(0).get_connection().set_source(parameter_node.out_port(0))
preprocessing_output_node_id = replacement_descriptions['preprocessing_output_node']
assert preprocessing_output_node_id in graph.nodes, 'The node with name "{}" is not found in the graph. This ' \

View File

@ -2,7 +2,7 @@
{
"id": "AutomlEfficientDet",
"custom_attributes": {
"preprocessing_input_node": "convert_image",
"preprocessing_input_node": "strided_slice_1",
"preprocessing_output_node": "truediv",
"aspect_ratios": [1.0, 1.0, 1.4, 0.7, 0.7, 1.4],
"variance": [1.0, 1.0, 1.0, 1.0],