tensorflow: TF 2.0: Invalid argument: Unsupported type: 21

Hello guys,

Did any of you encounter this weird warning when training any network:

E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] constant folding failed: Invalid argument: Unsupported type: 21

warning_error

I am using Adam optimizer, however, I tried other optimizers but nothing changes!

And, this warning appeared just after I set-up the Tensorboard using callbacks: tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir, histogram_freq=1)

To set-up the Tensorboard I used: pip install -q tf-nightly-2.0-preview

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (1 by maintainers)

Most upvoted comments

the same happens with tf-gpu-2.0.0beta1

what is the “21” type? this happens to us even on 1.14…

I believe is the tf.variant dtype: https://github.com/tensorflow/tensorflow/blob/r2.0/tensorflow/core/framework/types.proto#L39

@achandraa thanks for the reply.

I resolved the issue by uninstalling tf-nightly-2.0-preview and installing fresh TF 2.0 GPU Alpha using pip install tensorflow-gpu==2.0.0-alpha0.

The problem was that the TF was not using GPUs anymore (after nightly installed), therefore my machine CPUs with tf-nightly-2.0-preview caused those warning!

For the sake of reporting, I can share some of the specs of the machine I’m using, even though, I was able to fix the issue myself.

  • Code: a FC network using tf.keras.Sequential and tf.keras.layers. Using tf.keras.optimizers.Adam (however the issue happens with other optimizers as well, included from the same module tf.keras.optimizers)
  • OS: Arch Linux
  • TF: GPU 2.0 Alpha
  • Tf-nightly: pip install -q tf-nightly-2.0-preview (this install caused the issue)
  • Python: 3.7.2
  • GPUs: GeForce GTX 1080 (with CUDA)
  • CPUs (XLA_CPU): 10 x Intel® Core™ i7-6950X CPU @ 3.00GHz

I’m going to close this. Thanks.