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
I am on MacOS Sierra with CPU only nightly.
tf.git_version is 0.12.0-rc0-1156-g8c18a00-dirty.
The error comes from the gradient calculation in concat_v2 when axis = -1 is used to get the last dimension. I could not find axis=-1 documentation for concat_v2 but that is how crelu is implemented.
Concat_v2 along last dimension as a positive int works fine. The forward pass with axis = -1 also works fine, it is just getting a gradient that gives an error.
Reproduce with:
import tensorflow as tf
inputs = tf.random_normal([64, 32,32, 3])
inputs2 = tf.random_normal([64, 32,32, 3])
hidden = tf.concat_v2([inputs, inputs2], axis=-1) # axis = 3 works fine
grad = tf.gradients(hidden, [inputs])
with tf.Session() as sess:
print( sess.run(grad))
Gives error:
...which was originally created as op u'concat_v2', defined at:
File "crelu.py", line 5, in
hidden = tf.concat_v2([inputs, inputs2], axis=-1)
File "/Users/mikowals/projects/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1062, in concat_v2
name=name)
File "/Users/mikowals/projects/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 498, in _concat_v2
name=name)
File "/Users/mikowals/projects/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/Users/mikowals/projects/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2389, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/Users/mikowals/projects/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1264, in init
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): Concat dim is out of range: -1 vs. 4
[[Node: gradients/concat_v2_grad/ConcatOffset = ConcatOffset[N=2, _device="/job:localhost/replica:0/task:0/cpu:0"](concat_v2/axis, gradients/concat_v2_grad/Shape, gradients/concat_v2_grad/Shape_1)]]
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. I can reproduce this on the nightly build as well. Looks like grad might not support negative axes. We'll look into it. As you say the work around is to use non-negative axes for now.
caisq
pushed a commit
to caisq/tensorflow
that referenced
this issue
Jan 8, 2017
…uple
Imported from GitHub PR openxla/xla#6377
Some while loops might not be rooted on a tuple.
This removes the check to assert on such situation.
Addressed issue: openxla/xla#6353
Copybara import of the project:
--
d454d73618f606360f2eff896093045896419c46 by TJ <tjx@nvidia.com>:
Fix the check failure where while loop is not rooted on a tuple
--
c5fccd1f594cf2bf1b54daa60f05e71eecea58e8 by TJ <tjx@nvidia.com>:
removed redundant code in tests
Merging this change closes#6377
PiperOrigin-RevId: 574847170
I am on MacOS Sierra with CPU only nightly.
tf.git_version is 0.12.0-rc0-1156-g8c18a00-dirty.
The error comes from the gradient calculation in concat_v2 when axis = -1 is used to get the last dimension. I could not find axis=-1 documentation for concat_v2 but that is how crelu is implemented.
Concat_v2 along last dimension as a positive int works fine. The forward pass with axis = -1 also works fine, it is just getting a gradient that gives an error.
Reproduce with:
Gives error:
The text was updated successfully, but these errors were encountered: