NaN appearing on tf.gradients calculation with tf.where and division by zero on the false branch #20091
Labels
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
8000
Uh oh!
There was an error while loading. Please reload this page.
System information
Yes, script is below
Linux 4.15.0-23-generic Cuda 3.0? #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
VERSION="18.04 LTS (Bionic Beaver)"
binary
v1.8.0-0-g93bc2e2072 1.8.0
Python 3.6.5
Describe the problem
When using the tf.where function where a division by zero exists in one of the two where branches, you get a NaN gradient even if the division by zero was on the where branch which was not executed.
This seems similar to #2540 but the workarounds suggested there (e.g. using tf.boolean_mask) did not work.
Source code / logs
Program output:
#[array([0.], dtype=float32), array([nan], dtype=float32)]
The text was updated successfully, but these errors were encountered: