After trained and freez my network in the transformation step I have :
Model Optimizer version: 22.214.171.12435e231
[ ERROR ] List of operations that cannot be converted to IE IR:
[ ERROR ] Pow (16)
[ ERROR ] pow
[ ERROR ] pow_1
[ ERROR ] pow_2
[ ERROR ] pow_3
[ ERROR ] pow_4
[ ERROR ] pow_5
[ ERROR ] pow_6
[ ERROR ] pow_7
[ ERROR ] pow_8
[ ERROR ] pow_9
[ ERROR ] pow_10
[ ERROR ] pow_11
[ ERROR ] pow_12
[ ERROR ] pow_13
[ ERROR ] pow_14
[ ERROR ] pow_15
[ ERROR ] Part of the nodes was not translated to IE. Stopped.
So, my solution is to create extension file .py to overwrite the missing operation.
import networkx as nx
from mo.front.common.replacement import FrontReplacementOp
from mo.ops.power import Power
from mo.graph.graph import Node
op = "Pow"
enabled = True
def replace_op(self, graph: nx.MultiDiGraph, node: Node):
p = Power(graph, dict(scale=2, name=node.name + '/pow_'))
out_node = p.create_node([node.in_node(0)])
The file is execute and works.
Now, model Optimizer is able to create IR model, but the results are little bit different as my expectation.
Is this a right solution?
I guess that the mistake is at the line below, you have scale while it should be power. With scale=2, your operation was a multiply by 2 instead of a power of 2.
p = Power(graph, dict(power=2, name=node.name + '/pow_'))