You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to use the PlaidML backend in my code, I encountered a problem when trying to flatten my input.
Traceback (most recent call last):
File "ddpq_dreams.py", line 73, in <module>
actor.add(Flatten(input_shape=(1, ) + env.observation_space.shape))
File "/usr/local/anaconda3/lib/python3.6/site-packages/keras/models.py", line 442, in add
layer(x)
File "/usr/local/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 602, in __call__
output = self.call(inputs, **kwargs)
File "/usr/local/anaconda3/lib/python3.6/site-packages/keras/layers/core.py", line 484, in call
return K.batch_flatten(inputs)
File "/usr/local/anaconda3/lib/python3.6/site-packages/plaidml/keras/backend.py", line 1008, in batch_flatten
return x.batch_flatten()
File "/usr/local/anaconda3/lib/python3.6/site-packages/plaidml/keras/backend.py", line 509, in batch_flatten
new_shape = (self.shape[0], reduce(operator.mul, self.shape[1:]))
NameError: name 'reduce' is not defined
The same error actually happens when executing a the plaidvision and plaidbench examples with a few of the models e.g. python plaidvision.py resnet50 and python plaidbench.py resnet50 --print-stacktraces:
Using PlaidML backend.
INFO:plaidml:b'Opening device "amd_radeon_r9_m370x_compute_engine.0'
Traceback (most recent call last):
File "plaidvision.py", line 310, in <module>
main()
File "plaidvision.py", line 260, in main
model = Model(args.model, args.weights)
File "plaidvision.py", line 206, in __init__
self.model = ModelClass(weights=weights)
File "/usr/local/anaconda3/lib/python3.6/site-packages/keras/applications/resnet50.py", line 235, in ResNet50
x = Flatten()(x)
File "/usr/local/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 602, in __call__
output = self.call(inputs, **kwargs)
File "/usr/local/anaconda3/lib/python3.6/site-packages/keras/layers/core.py", line 484, in call
return K.batch_flatten(inputs)
File "/usr/local/anaconda3/lib/python3.6/site-packages/plaidml/keras/backend.py", line 1008, in batch_flatten
return x.batch_flatten()
File "/usr/local/anaconda3/lib/python3.6/site-packages/plaidml/keras/backend.py", line 509, in batch_flatten
new_shape = (self.shape[0], reduce(operator.mul, self.shape[1:]))
NameError: name 'reduce' is not defined
I believe this issue is related to python 3.6. 'reduce' moved from a free function to into the functools module. Thanks for reporting it, we will try to correct this as soon as possible. Currently the 3.6 version has limited test coverage. We are expanding our internal and open source test intergration to help find such issues earlier.
Great project — thanks for making it!
While trying to use the PlaidML backend in my code, I encountered a problem when trying to flatten my input.
The same error actually happens when executing a the plaidvision and plaidbench examples with a few of the models e.g.
python plaidvision.py resnet50
andpython plaidbench.py resnet50 --print-stacktraces
:System:
MacBook Pro (Retina, 15-inch, Mid 2015)
AMD Radeon R9 M370X 2 GB
macOS 10.13
Python 3.6.2
Keras (2.0.8)
plaidml (0.1.1)
plaidml-keras (0.1.1)
Please let me know if you need more information.
The text was updated successfully, but these errors were encountered: