Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'MatMul' #28

Open
pbelecky opened this issue Nov 18, 2020 · 0 comments
Open

KeyError: 'MatMul' #28

pbelecky opened this issue Nov 18, 2020 · 0 comments

Comments

@pbelecky
Copy link

pbelecky commented Nov 18, 2020

Error while running nngen.from_onnx()

Download the onnx file:
https://github.com/onnx/models/blob/master/vision/classification/mnist/model/mnist-1.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='mnist-1.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/basic.py", line 89, in Add
    return _normalize_elementwise(method, None, visitor, node, np.add)
  File "/home/u/tensorflow/nngen_try3/nngen/nngen/onnx/basic.py", line 20, in _normalize_elementwise
    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: 'MatMul'
@pbelecky pbelecky changed the title KeyError: 'MatMul' KeyError: 'MatMul' while running nngen.from_onnx() Nov 18, 2020
@pbelecky pbelecky changed the title KeyError: 'MatMul' while running nngen.from_onnx() KeyError: 'MatMul' Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant