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
NotImplementedError: Cannot convert a symbolic Tensor (Train_gpu0/Loss_R1/gradients/Train_gpu0/Augment_1/transform/ImageProjectiveTransformV2_grad/flat_transforms_to_matrices/strided_slice:0) to a numpy array.
#112
Open
kay-aki opened this issue
Jun 13, 2022
· 0 comments
I am trying to train a GAN but this issue occurs all the time. I do not know if it is a bug or if I am making something wrong. I am using tensorflow 1.x on google colab.
The last line it is executing is: !python train.py --outdir='/content/drive/MyDrive/stylegan2-ada/training-runs' --gpus=1 --data='/content/drive/MyDrive/stylegan2-ada/datasets/{dataset_name}'
I tried it with some other training configurations but the same error occurred every time
Output directory: /content/drive/MyDrive/stylegan2-ada/training-runs/00001-Pferde-auto1
Training data: /content/drive/MyDrive/stylegan2-ada/datasets/Pferde
Training length: 25000 kimg
Resolution: 256
Number of GPUs: 1
Exporting sample images...
Replicating networks across 1 GPUs...
Initializing augmentations...
Setting up optimizers...
Constructing training graph...
Traceback (most recent call last):
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/ops.py", line 2380, in get_attr
c_api.TF_OperationGetAttrValueProto(self._c_op, name, buf)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Operation 'Train_gpu0/Augment_1/transform/ImageProjectiveTransformV2' has no attr named '_XlaCompile'.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/gradients_util.py", line 345, in _MaybeCompile
xla_compile = op.get_attr("_XlaCompile")
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/ops.py", line 2384, in get_attr
raise ValueError(str(e))
ValueError: Operation 'Train_gpu0/Augment_1/transform/ImageProjectiveTransformV2' has no attr named '_XlaCompile'.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 561, in
main()
File "train.py", line 553, in main
run_training(**vars(args))
File "train.py", line 451, in run_training
training_loop.training_loop(**training_options)
File "/content/drive/MyDrive/stylegan2-ada/training/training_loop.py", line 187, in training_loop
terms = dnnlib.util.call_func_by_name(G=G_gpu, D=D_gpu, aug=aug, fake_labels=fake_labels, real_images=real_images_var, real_labels=real_labels_var, **loss_args)
File "/content/drive/MyDrive/stylegan2-ada/dnnlib/util.py", line 281, in call_func_by_name
return func_obj(*args, **kwargs)
File "/content/drive/MyDrive/stylegan2-ada/training/loss.py", line 110, in stylegan2
r1_grads = tf.gradients(tf.reduce_sum(D_real.scores), [real_images])[0]
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/gradients_impl.py", line 158, in gradients
unconnected_gradients)
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/gradients_util.py", line 679, in _GradientsHelper
lambda: grad_fn(op, *out_grads))
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/gradients_util.py", line 350, in _MaybeCompile
return grad_fn() # Exit early
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/gradients_util.py", line 679, in
lambda: grad_fn(op, *out_grads))
File "/tensorflow-1.15.2/python3.7/tensorflow_core/contrib/image/python/ops/image_ops.py", line 420, in _image_projective_transform_grad
transforms = flat_transforms_to_matrices(transforms=transforms)
File "/tensorflow-1.15.2/python3.7/tensorflow_core/contrib/image/python/ops/image_ops.py", line 362, in flat_transforms_to_matrices
[transforms, array_ops.ones([num_transforms, 1])], axis=1),
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/array_ops.py", line 2560, in ones
output = _constant_if_small(one, shape, dtype, name)
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/array_ops.py", line 2295, in _constant_if_small
if np.prod(shape) < 1000:
File "<array_function internals>", line 6, in prod
File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 3052, in prod
keepdims=keepdims, initial=initial, where=where)
File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/ops.py", line 736, in array
" array.".format(self.name))
NotImplementedError: Cannot convert a symbolic Tensor (Train_gpu0/Loss_R1/gradients/Train_gpu0/Augment_1/transform/ImageProjectiveTransformV2_grad/flat_transforms_to_matrices/strided_slice:0) to a numpy array.
Kind regards!
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to train a GAN but this issue occurs all the time. I do not know if it is a bug or if I am making something wrong. I am using tensorflow 1.x on google colab.
The last line it is executing is:
!python train.py --outdir='/content/drive/MyDrive/stylegan2-ada/training-runs' --gpus=1 --data='/content/drive/MyDrive/stylegan2-ada/datasets/{dataset_name}'
I tried it with some other training configurations but the same error occurred every time
Here is the output of the program:
Kind regards!
The text was updated successfully, but these errors were encountered: