plaidml / onnx-plaidml

An ONNX backend using PlaidML
GNU Affero General Public License v3.0
28 stars 8 forks source link

ImportError: cannot import name 'onnx_pb2' #14

Closed jack-willturner closed 6 years ago

jack-willturner commented 6 years ago

Having trouble getting set up. These are the exact commands I run:

conda install -q -y -c conda-forge onnx
pip install -q onnx-plaidml
plaidml-setup

When in plaidml-setup:

Default Config Devices:
   opencl_nvidia_tesla_k20m.0 : NVIDIA Corporation Tesla K20m (OpenCL)

Experimental Config Devices:
   llvm_cpu.0 : CPU (LLVM)

Using experimental devices can cause poor performance, crashes, and other nastiness.

Enable experimental device support? (y,n)[n]:

If I enter n then:

No devices available in chosen config. Rerun plaidml-setup.

So I enter y and it chooses the CPU.

Then from the python toplevel:

>>> import onnx
>>> import onnx_plaidml.backend

Produces:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/miniconda3/envs/plaidml-venv/lib/python3.5/site-packages/onnx_plaidml/backend.py", line 18, in <module>
    from onnx import onnx_pb2
ImportError: cannot import name 'onnx_pb2'

I noticed that onnx_pb2 direct usage has been removed from ONNX https://github.com/onnx/onnx/pull/292. Should I downgrade to a specific version of ONNX?

Thanks

jack-willturner commented 6 years ago

I've just noticed that the current version of backend.py uses onnx_pb instead of onnx_pb2 - so installing from source works fine but installing via pip doesn't.

I tried pip install --upgrade onnx_plaidml but it said Requirement already up-to-date.