Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Mspiz
New Contributor I
112 Views

Tensorflow issue missing operation

Hi,

After trained and freez my network in the transformation step I have :

Model Optimizer version:     1.2.185.5335e231
[ 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


class pow(FrontReplacementOp):

    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)])    
        return [out_node.id]

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?

 

0 Kudos
2 Replies
Severine_H_Intel
Employee
112 Views

Dear Carmine, 

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_'))

Best,

Severine

Mspiz
New Contributor I
112 Views

Hi Habert, thanks for your suggestion. I think is right. Unfortunately in my case not work to achieve the target. I'm looking for found what's wrong in this pipeline. Cheers, Carmine
Reply