Thursday, April 28, 2022

[FIXED] How to turn off tensorflow contrib module warning

Issue

I'm still using tensorflow 1.15 and won't use tensorflow 2.0 for current project.

I'd like to know how can I turn off this warning message:

WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
If you depend on functionality not listed there, please file an issue.

I've read the metioned pages, but still don't know how to turn off that message.


Solution

After a careful searching I found the answer in https://github.com/tensorflow/tensorflow/issues/27045#issuecomment-480691244

import tensorflow as tf
if type(tf.contrib) != type(tf): tf.contrib._warning = None


Answered By - ChrisZZ
Answer Checked By - Robin (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.