'Cannot run PlaidML: 'str' object has no attribute 'decode'

I am trying to run Keras with my GPU on my Macbook Pro (2020). tried to run a test with plaidml

$ plaidbench keras mobilenet

I get the following error:

'str' object has no attribute 'decode'
Set --print-stacktraces to see the entire traceback

I read to install h5py==2.10.0 However, this fails since it's not able to build a wheel for h5py==2.10.0

These are my installed packaged:

keras==2.2.4
tensorflow==2.5.3
pyopencl==2021.2.13
plaidml-keras==0.7.0
plaidbench==0.7.0

Python version (installed via virtualenv): 3.9.7

Please help!!

:)



Solution 1:[1]

You can avoid the problem by editing keras' code...

Access your 'site-packages' directory ... to open up 'saving.py'

i.e. /usr/lib/python3.9/site-packages/keras/engine/saving.py

Then go to line 1004 and 1008 to comment out .decode('utf-8') parts of the code.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Taylor Shin