[MO] Fix many spelling and grammar errors (#2543)
This commit is contained in:
1 parent
af661ae0fe
commit
0e502ffb35
35 files changed
+46
-46
No files matched your search
@@ -86,7 +86,7 @@ class TensorFlowYOLOV1V2Analysis(AnalyzeAction):
|
||||
"\t--input_model <path_to_model>/<model_name>.pb\n" \
|
||||
"\t--batch 1\n" \
|
||||
"\t--tensorflow_use_custom_operations_config <OPENVINO_INSTALL_DIR>/deployment_tools/model_optimizer/extensions/front/tf/<yolo_config>.json\n" \
|
||||
"All detailed information about conversion of this model can be fount at\n" \
|
||||
"All detailed information about conversion of this model can be found at\n" \
|
||||
"https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_YOLO_From_Tensorflow.html"
|
||||
return {'model_type': {'YOLO': get_YOLO_params_by_flavor(flavor)}}, message
|
||||
else:
|
||||
@@ -113,7 +113,7 @@ class TensorFlowYOLOV3Analysis(AnalyzeAction):
|
||||
"\t--input_model <path_to_model>/yolo_v3.pb\n" \
|
||||
"\t--batch 1\n" \
|
||||
"\t--tensorflow_use_custom_operations_config <OPENVINO_INSTALL_DIR>/deployment_tools/model_optimizer/extensions/front/tf/yolo_v3.json\n" \
|
||||
"Detailed information about conversion of this model can be fount at\n" \
|
||||
"Detailed information about conversion of this model can be found at\n" \
|
||||
"https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_YOLO_From_Tensorflow.html"
|
||||
return {'model_type': {'YOLO': get_YOLO_params_by_flavor(flavor)}}, message
|
||||
else:
|
||||
|
||||
@@ -138,7 +138,7 @@ class ShuffleChannelFusion(BackReplacementPattern):
|
||||
We are able to perform the fusion if the pattern satisfies the conditions:
|
||||
1. Pattern input 4D shape is the same as pattern output 4D shape
|
||||
2. First Reshape splits channel dimension (1 axis) into two dimensions
|
||||
3. Transpose permutes only splitted dimensions
|
||||
3. Transpose permutes only split dimensions
|
||||
4. Second Reshape pack them back
|
||||
|
||||
Fixes original models reshape-ability (Smart reshape)
|
||||
@@ -208,7 +208,7 @@ class DepthToSpaceFusion(BackReplacementPattern):
|
||||
We are able to perform the fusion if the pattern satisfies the conditions:
|
||||
1. Pattern has 6D input and 4D output
|
||||
2. First Reshape splits channel dimension (1 axis) into three dimensions [new_depth, block_size, block_size]
|
||||
3. Transpose permutes splitted dimensions with spatial ones
|
||||
3. Transpose permutes split dimensions with spatial ones
|
||||
4. Second Reshape pack block size together with spatial dimension
|
||||
|
||||
Fixes original models reshape-ability (Smart reshape)
|
||||
|
||||
@@ -80,7 +80,7 @@ class CreateConstNodesReplacement(BackReplacementPattern):
|
||||
def replace_pattern(self, graph: Graph, match: dict):
|
||||
"""
|
||||
Adds layers with type 'Const' that produce blob from 'bin' file. The pass finds data nodes with one output which
|
||||
doesn't have edge with 'bin' attribute (or with two outputs and at least one output havent 'bin' attr)
|
||||
doesn't have edge with 'bin' attribute (or with two outputs and at least one output doesn't have 'bin' attr)
|
||||
and generate Const op node before the node and data node before the Const node. The data node before 'Const'
|
||||
node is needed because the op node dumps input tensors to bin file.
|
||||
"""
|
||||
|
||||
@@ -88,7 +88,7 @@ class MemoryOffsetAdjustment(FrontReplacementSubgraph):
|
||||
\ |
|
||||
\ |
|
||||
Concat
|
||||
In Left branch we have MemoryOffset with k > 0 so we wait until kth frame will be calcualted. In right branch
|
||||
In Left branch we have MemoryOffset with k > 0 so we wait until kth frame will be calculated. In right branch
|
||||
we have no such offsets. As result we Concat (or use in any calculations with more than 1 input) kth frame from
|
||||
left branch and 0th from right branch. So we need to add synchronization before Concat node. it can be done with
|
||||
MemoryOffset(k) inserted before Concat.
|
||||
|
||||
@@ -29,7 +29,7 @@ from mo.ops.const import Const
|
||||
class SsdPatternAnchorReshape(FrontReplacementSubgraph):
|
||||
"""
|
||||
Find ssd anchors and setup variants values.
|
||||
Need to provide compatibility wit IE DetectionOutpyt layer.
|
||||
Need to provide compatibility with IE DetectionOutput layer.
|
||||
"""
|
||||
enabled = True
|
||||
graph_condition = [lambda graph: graph.graph['fw'] == 'mxnet' and graph.graph['cmd_params'].enable_ssd_gluoncv]
|
||||
|
||||
@@ -52,7 +52,7 @@ class UpsampleFrontExtractor(FrontExtractorOp):
|
||||
)
|
||||
if math.fabs(scales[0] - 1) > 1e-5 or math.fabs(scales[1] - 1) > 1e-5:
|
||||
raise Error(
|
||||
'Upsampling of batch and feature dimentions is not supported for node {}.',
|
||||
'Upsampling of batch and feature dimensions is not supported for node {}.',
|
||||
node.name
|
||||
)
|
||||
height_scale = scales[2]
|
||||
|
||||
@@ -73,7 +73,7 @@ class UpsampleONNXExtractorTest(BaseExtractorsTestingClass):
|
||||
def test_invalid_scales(self):
|
||||
inp, ref = self._base_attrs()
|
||||
inp['scales'] = [1.5, 1.5, 2.0, 2.0]
|
||||
with self.assertRaisesRegex(Error, '.*Upsampling of batch and feature dimentions is not supported for node.*'):
|
||||
with self.assertRaisesRegex(Error, '.*Upsampling of batch and feature dimensions is not supported for node.*'):
|
||||
out = self._extract(inp)
|
||||
|
||||
def test_invalid_2D_scales(self):
|
||||
|
||||
@@ -37,7 +37,7 @@ def is_value_is_constant(val: np.ndarray, const: [int, float]):
|
||||
class FlattenToReshapeableReshape(FrontReplacementSubgraph):
|
||||
"""
|
||||
The TensorFlow implementation of the Flatten operation is not reshape-able because the batch size is hardcoded
|
||||
during te constant propagation. This transform sets the 'dim' attribute for the Reshape to [0, -1].
|
||||
during the constant propagation. This transform sets the 'dim' attribute for the Reshape to [0, -1].
|
||||
"""
|
||||
enabled = True
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class BinarizeWeightsM1P1(MiddleReplacementPattern):
|
||||
transparent.
|
||||
|
||||
#TODO Describe how to apply multiplication at output ports -- this is not specified. In the current definition
|
||||
we can pass through only scalar multiplication, but we already requre passing it channel-wise.
|
||||
we can pass through only scalar multiplication, but we already require passing it channel-wise.
|
||||
"""
|
||||
enabled = True
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class BlockLSTMtoLSTMSequence(MiddleReplacementPattern):
|
||||
concatenated cell states over the whole time sequence -> last cell state
|
||||
|
||||
BlockLSTM
|
||||
|| out 1 (concatenated cell states comming out of BlockLSTM)
|
||||
|| out 1 (concatenated cell states coming out of BlockLSTM)
|
||||
\/ in 1
|
||||
ConcatV2
|
||||
|| (concatenation with initial state or another unused data)
|
||||
@@ -265,10 +265,10 @@ class BlockLSTMtoLSTMSequence(MiddleReplacementPattern):
|
||||
list_of_concatenated_hidden_states_children_node_ids.append(node.id)
|
||||
|
||||
if len(list_of_concatenated_hidden_states_children_node_ids) != 1:
|
||||
return # not supported placement of patten
|
||||
return # not supported placement of pattern
|
||||
conacenated_child_node_id = list_of_concatenated_hidden_states_children_node_ids[0]
|
||||
if conacenated_child_node_id != match['after_mul_op_to_the_rest_of_model'].id:
|
||||
return # not supported placement of patten
|
||||
return # not supported placement of pattern
|
||||
|
||||
gather_indexes = match['gather_0'].in_node(1).value
|
||||
if len(gather_indexes) == 1:
|
||||
|
||||
@@ -24,7 +24,7 @@ from mo.ops.op import Op
|
||||
class ONNXRNNSequenceNormalize(MiddleReplacementPattern):
|
||||
"""
|
||||
Convert blobs and shapes of ONNX-like LSTM, GRU, RNN cells to common form (internal for MO).
|
||||
After this normalization pass passes for spliting bidirectional calls and
|
||||
After this normalization pass passes for splitting bidirectional calls and
|
||||
multilayer cells will be applied.
|
||||
|
||||
This transformation pass involves weights and shapes processing only:
|
||||
|
||||
@@ -142,7 +142,7 @@ class ClampQuantizeMark(MiddleReplacementPattern):
|
||||
return
|
||||
max_value = quantize.in_port(2).data.get_value()
|
||||
if max_value is None:
|
||||
log.debug('ReluQuantizeFuse: cannot fuse because FakeQuantize op has dynamic input on the 2st port, '
|
||||
log.debug('ReluQuantizeFuse: cannot fuse because FakeQuantize op has dynamic input on the 2nd port, '
|
||||
'levels=`{}`'.format(quantize.levels))
|
||||
return
|
||||
if np.all(min_value >= clamp_min) and np.all(max_value <= clamp_max):
|
||||
|
||||
@@ -144,7 +144,7 @@ class SmartInputMatcher(MiddleReplacementPattern):
|
||||
if shape['kind'] == 'op' and shape['op'] == 'Const':
|
||||
start = 0
|
||||
end = shape.value[0]
|
||||
log.warning("You network cannot be reshaped since shapes of placeholders is a contants."
|
||||
log.warning("Your network cannot be reshaped since shapes of placeholders are constants."
|
||||
"Please, provide non-constant shapes. ")
|
||||
|
||||
# Create input node with params
|
||||
|
||||
@@ -186,7 +186,7 @@ class TransposeTensorIteratorLSTM(MiddleReplacementPattern):
|
||||
assert len(data_output_port) == 1
|
||||
data_input_port = data_input_port[0]
|
||||
data_output_port = data_output_port[0]
|
||||
# Verify that they are really connected to Transpose layers (guarantied by port numbers of TI, see the pattern)
|
||||
# Verify that they are really connected to Transpose layers (guaranteed by port numbers of TI, see the pattern)
|
||||
assert ti.in_edge(0)['external_port_id'] == ti.input_port_map[data_input_port]['external_port_id']
|
||||
assert ti.out_edge(0)['external_port_id'] == ti.output_port_map[data_output_port]['external_port_id']
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class ReverseTensorIteratorLSTM(MiddleReplacementPattern):
|
||||
|
||||
if not self.is_fusable_reverse_sequence(direct_reverse) or \
|
||||
not self.is_fusable_reverse_sequence(inverse_reverse):
|
||||
# we can not merge ReverseSequence with ot equal sequences
|
||||
# we can not merge ReverseSequence without equal sequences
|
||||
return
|
||||
|
||||
# Modify stride in TI
|
||||
|
||||
@@ -66,7 +66,7 @@ class FakeQuantize(Op):
|
||||
inputs = [node.in_node(i) for i in range(5)]
|
||||
x, input_low, input_high, output_low, output_high = inputs
|
||||
assert x.has_valid('shape')
|
||||
# TODO Check all input[1..4] shapes are broadcastable to intput[0] shape
|
||||
# TODO Check all inputs[1..4] shapes are broadcastable to inputs[0] shape
|
||||
assert all([broadcastable(inputs[i].shape, inputs[0].shape) for i in range(1, 5)]), \
|
||||
"Not all shapes from FakeQuantize inputs can be broadcasted to input[0] for node {}".format(
|
||||
node.soft_get('name'))
|
||||
|
||||
@@ -61,6 +61,6 @@ class SparseReshape(Op):
|
||||
output_indices_shape = np.concatenate((input_indices_shape[0:1], new_shape_shape))
|
||||
node.out_port(0).data.set_shape(output_indices_shape)
|
||||
|
||||
# TODO: implement constant value propogation for common case
|
||||
# TODO: implement constant value propagation for common case
|
||||
if np.array_equal(input_shape_value, output_shape_value) and input_indices_value is not None:
|
||||
node.out_port(0).data.set_value(input_indices_value)
|
||||
@@ -28,7 +28,7 @@ class SparseSegmentSqrtN(Op):
|
||||
- [0, required] Data tensor from which rows are selected for the sum divided by sqrt of N (ND),
|
||||
- [1, required] Tensor of indices of selected rows from the first input tensor along 0 dimension (1D),
|
||||
- [2, required] Tensor of segment IDs to which selected rows belong.
|
||||
Selected rows beloging to the same segment are summed up. The tensor has the same size as the second input.
|
||||
Selected rows belonging to the same segment are summed up. The tensor has the same size as the second input.
|
||||
Values must be sorted and can be repeated. (1D).
|
||||
|
||||
One output:
|
||||
|
||||
@@ -28,7 +28,7 @@ class SparseSegmentSum(Op):
|
||||
- [0, required] Data tensor from which rows are selected for the sum (ND),
|
||||
- [1, required] Tensor of indices of selected rows from the first input tensor along 0 dimension (1D),
|
||||
- [2, required] Tensor of segment IDs to which selected rows for the sum belong.
|
||||
Selected rows beloging to the same segment are summed up. The tensor has the same size as the second input.
|
||||
Selected rows belonging to the same segment are summed up. The tensor has the same size as the second input.
|
||||
Values must be sorted and can be repeated. (1D).
|
||||
|
||||
One output:
|
||||
|
||||
@@ -110,10 +110,10 @@ class VariadicSplitBase(Op):
|
||||
# value propagation
|
||||
input_value = node.in_port(0).data.get_value()
|
||||
if input_value is not None:
|
||||
splitted = np.split(input_value, idxs[:-1], axis)
|
||||
split = np.split(input_value, idxs[:-1], axis)
|
||||
for i, port in node.out_ports().items():
|
||||
if not port.disconnected():
|
||||
port.data.set_value(splitted[i])
|
||||
port.data.set_value(split[i])
|
||||
|
||||
if op == 'VariadicSplit':
|
||||
PermuteInputs().set_input_permutation(node.in_node(1), node, 'input:0', 'axis')
|
||||
|
||||
@@ -213,7 +213,7 @@ class TensorIterator(Op):
|
||||
internal_node = node_map[internal_node_id]
|
||||
|
||||
if internal_node.soft_get('type') != 'Result':
|
||||
# this output wont get out of the body, but it is still Result and needed on non first iterations of TI
|
||||
# this output won't get out of the body, but it is still Result and needed on non first iterations of TI
|
||||
assert 'from_port' in record
|
||||
out_port = TensorIterator.special_port_to_real_port(internal_node, record['from_port'], 'out')
|
||||
assert out_port in internal_node.out_ports() and not internal_node.out_port(out_port).disconnected()
|
||||
@@ -300,7 +300,7 @@ class TensorIterator(Op):
|
||||
def generate_port_map(node: Node, src_port_map):
|
||||
""" Extract port_map attributes from node and node.body attributes.
|
||||
|
||||
It iterates over src_port_map and substitude external_port_id, internal_port_id and
|
||||
It iterates over src_port_map and substitute external_port_id, internal_port_id and
|
||||
internal_layer_id by real values queried from node ports and node.body attributes.
|
||||
"""
|
||||
result_list = []
|
||||
|
||||
@@ -38,7 +38,7 @@ class Unique(Op):
|
||||
and sorted in the same order as in the input (1D)
|
||||
- [1, optional] tensor of indices for each value of the input
|
||||
in the tensor of unique elements (1D)
|
||||
- [2, optional] tensor with a number of occurences for each unique element
|
||||
- [2, optional] tensor with a number of occurrences for each unique element
|
||||
in the input (1D)
|
||||
'''
|
||||
op = 'Unique'
|
||||
|
||||
Reference in new issue
Block a user