nngen icon indicating copy to clipboard operation
nngen copied to clipboard

KeyError: 'Softmax'

Open pbelecky opened this issue 4 years ago • 2 comments

Error while running nngen.from_onnx()

Download the onnx file: https://github.com/onnx/models/blob/master/vision/classification/alexnet/model/bvlcalexnet-3.onnx

And run Python code:

import os
import sys

sys.path.insert(0, os.path.dirname(os.path.dirname(
    os.path.dirname(os.path.abspath(__file__)))))

import nngen as ng

act_dtype=ng.int16
weight_dtype=ng.int8
bias_dtype=ng.int32
scale_dtype=ng.int8
disable_fusion=False
onnx_filename='bvlcalexnet-3.onnx'

dtypes = {}
ng.from_onnx(onnx_filename,
             value_dtypes=dtypes,
             default_placeholder_dtype=act_dtype,
             default_variable_dtype=weight_dtype,
             default_constant_dtype=weight_dtype,
             default_operator_dtype=act_dtype,
             default_scale_dtype=scale_dtype,
             default_bias_dtype=bias_dtype,
             disable_fusion=disable_fusion)

the output is:

Traceback (most recent call last):
  File "load_onnx.py", line 25, in <module>
    disable_fusion=disable_fusion)
  File "/home/u/tensorflow/nngen_try3/nngen/nngen/onnx/__init__.py", line 329, in from_onnx
    visitor.visit(name)
  File "/home/u/tensorflow/nngen_try3/nngen/nngen/onnx/__init__.py", line 146, in visit
    node_func = _get_func(node.op_type)
  File "/home/u/tensorflow/nngen_try3/nngen/nngen/onnx/__init__.py", line 75, in _get_func
    return func_map[op_type]
KeyError: 'Softmax'

pbelecky avatar Nov 18 '20 17:11 pbelecky