Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

BUG(?) Sub graph replacement in caffe flow is missing

Rik_A_Intel
Employee
324 Views

Hi,

Trying to work through the example of using sub-graph replacement in the model optimiser, it seems that it's not possible to replace a sub graph in the caffe flow.

I've added a line to mo/pipeline/caffe.py ....

log.debug("After extract_node_attr")
print_graph_stat(graph)
FrontReplacementSubgraph.find_and_replace_all_patterns(graph) # ADDED THIS LINE
FrontReplacementOp.find_and_replace_all_patterns(graph)

graph = create_tensor_nodes(graph)
log.debug("After create_tensor_nodes")
print_graph_stat(graph)

.....

With that in place the subgraph replacement is happening as expected. 

0 Kudos
2 Replies
Yi_G_Intel1
Employee
324 Views

Could you give us more details about your usage case? If possible, Could you attach your files, so, I can try to reproduce.

0 Kudos
Rik_A_Intel
Employee
324 Views

Hi

I'm developing some fpga kernels under DLA which I'm plugging into OpenVino. As a simple case for this I attach a trivial example with caffe model, custom node (extensions/ops/neg_concat_relu.py) and subgraph replacement thing extensions\front\ncr_graph.py.

In this case, the resutls on a convolution are negated through a power layer and concatenated before the relu is applied. We  can optimise this in fpga with a few simple changes to the normal relu kernel which would mean we don't need to the power, or concat.

I can't share more details of our customer use case in a public forum but can be contacted on richard.allen@intel.com if needed.

Rik

0 Kudos
Reply