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

TopK error from onnx model misses "k" attribute

Chen__Boyuan
Beginner
166 Views

File "/opt/intel/openvino_2019.3.376/deployment_tools/model_optimizer/extensions/front/TopKNormalize.py", line 38, in find_and_replace_pattern
    assert topk_node.has_valid('k'), 'The TopK node "{}" misses "k" attribute'.format(topk_node.name)
AssertionError: The TopK node "TopK_101" misses "k" attribute

 

Some debug gives me:

1. 'k' is not in self.graph.node["TopK_101"].keys()

2. However, 'k' is present in the attribute of self.graph.node["TopK_101"].['pb']

input: "253"
output: "254"
output: "255"
name: "TopK_101"
op_type: "TopK"
attribute {
  name: "axis"
  i: 3
  type: INT
}
attribute {
  name: "k"
  i: 100
  type: INT
}

0 Kudos
1 Reply
SIRIGIRI_V_Intel
Employee
166 Views

Can you please answer the below questions:

  1. What is the topology of the model
  2. Is the model a public model or custom model
  3. What is the model optimizer command you have used to convert the model

We recommend to use the latest version of OpenVINO(2020.2). Could you please give a try and let us know the results.

Regards,

Ram prasad

Reply