plaidml: plaidml-setup fails with plaidml.exceptions.Unknown: unable to resolve type:

When running plaidml-setup I get

Traceback (most recent call last):
  File "/usr/local/bin/plaidml-setup", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/plaidml/plaidml_setup.py", line 44, in main
    devices, _ = plaidml.devices(ctx, limit=100, return_all=True)
  File "/usr/local/lib/python3.5/dist-packages/plaidml/__init__.py", line 1042, in devices
    enumerator = _Enumerator(ctx)
  File "/usr/local/lib/python3.5/dist-packages/plaidml/__init__.py", line 1000, in __init__
    ctx, ctypes.cast(None, _ENUM_DEVICES_FUNCTYPE), None)
  File "/usr/local/lib/python3.5/dist-packages/plaidml/__init__.py", line 746, in _check_err
    self.raise_last_status()
  File "/usr/local/lib/python3.5/dist-packages/plaidml/library.py", line 131, in raise_last_status
    raise self.last_status()
plaidml.exceptions.Unknown: unable to resolve type: 

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 1
  • Comments: 28 (7 by maintainers)

Most upvoted comments

This error happens if plaidml can’t find its config and experimental config files. You can explicitly point plaidml to your config files via the PLAIDML_DEFAULT_CONFIG and PLAIDML_EXPERIMENTAL_CONFIG environment variables.

In my case, I was encountering this issue on macOS due to plaidml looking in the wrong directory (likely the same root cause as #321 and #277). I fixed it by copying plaidml’s share files to the directory where it was looking:

cp -r ~/Library/Python/3.7/share/plaidml /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/share/plaidml

I’m having this issue too. Same two sets of errors as above.

As you say, on Mac OS, it is still not working on 0.6.1. Just did a clean install on a brand new OS installation.

brew install python3
pip3 install plaidml
plaidml-setup

First, when importing plaidml, it fails because it does not find ‘experimental.json’. I checked the path where it is looking for it, and it is ‘/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/share/plaidml/’. That last plaidml folder did not exist, I created it, and copied the config.json and experimental.json from this repo (Mac OS versions) there. Then, plaidml-setup goes on, but fails by not finding libplaidml.dylib. It was in /usr/local/lib, and after copying it to ‘/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/’, it worked fine.

/offtopic @rljacobson Try it with bazel <=0.21. I had the same problem