nngen
nngen copied to clipboard
KeyError: 'Dropout'
Error while running nngen.from_onnx()
Download the onnx file: https://github.com/onnx/models/blob/master/vision/body_analysis/arcface/model/arcfaceresnet100-8.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='arcfaceresnet100-8.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 147, in visit
node_op = node_func(self, node)
File "/home/u/tensorflow/nngen_try3/nngen/nngen/onnx/batchnormalization.py", line 55, in BatchNormalization
act_func=act_func)
File "/home/u/tensorflow/nngen_try3/nngen/nngen/onnx/gemm.py", line 28, in Gemm
src_obj = flatten.Flatten(visitor, src_node, no_transpose=True)
File "/home/u/tensorflow/nngen_try3/nngen/nngen/onnx/flatten.py", line 18, in Flatten
src_obj = visitor.visit(src)
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: 'Dropout'