Search code examples
python-3.xcomputer-visiononnx

ImportError: No module named 'onnx_backend'?


I have installed ONNx form this URL https://github.com/onnx/onnx , now trying to run some models form here https://github.com/onnx/models#face_detection , the problem is that when importing:

import numpy as np
import onnx

It works but when I try to import

import onnx_backend as backend

It gives me below error

Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import onnx_backend as backend
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'onnx_backend'

Otherwise I am able to load models without any error; how can I rectify the import error?


Solution

  • Try using -

    from onnx import backend
    

    insteed of

    import onnx_backend as back