plaidml / plaidml

PlaidML is a framework for making deep learning work everywhere.
https://ai.intel.com/plaidml
Apache License 2.0
4.58k stars 400 forks source link

plaidml.exceptions.Unknown: More indexes than dimensions for tensor: 1:X_T23 2 > 0 #296

Open leech74 opened 5 years ago

leech74 commented 5 years ago

I was trying the example from the Chapter 9 of the book "Python Reinforcement Learning Projects" and receive the error "plaidml.exceptions.Unknown: More indexes than dimensions for tensor: 1:X_T23 2 > 0". The same example ran ok in Tensorflow. Can someone tell why it does not work in PlaidML and how to fix it. The code for the book can be found here: “https://github.com/PacktPublishing/Python-Reinforcement-Learning-Projects

denise-k commented 5 years ago

This issue is related to the K.gradients function that's located within critic.py.

Both the Keras backend documentation and the TensorFlow documentation for the function gradients(loss, variables) state that loss should be a scalar tensor input. In your example, loss was a 2D tensor.

We ended up finding a way to implement gradients(loss, variables) in a way that works with an n-dimensional tensor input while remaining compatible with the existing code base. No action would be required on your end to make your code work with PlaidML once this fix is released.

Keep an eye out, it'll be in a future release!

blwhite7 commented 4 years ago

👀

Keep an eye out, it'll be in a future release!

dsimic commented 4 years ago

👀 :)