Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I fix this error with tensorflow warning?

Tags:

tensorflow

When the programme has been started in the console outputting:

WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.tracking.base has been moved to tensorflow.python.trackable.base. The old module will be deleted in version 2.11.
WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.checkpoint_management has been moved to tensorflow.python.checkpoint.checkpoint_management. The old module will be deleted in version 2.9.
WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.tracking.resource has been moved to tensorflow.python.trackable.resource. The old module will be deleted in version 2.11.
WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.tracking.util has been moved to tensorflow.python.checkpoint.checkpoint. The old module will be deleted in version 2.11.
WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.tracking.base_delegate has been moved to tensorflow.python.trackable.base_delegate. The old module will be deleted in version 2.11.
WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.tracking.graph_view has been moved to tensorflow.python.checkpoint.graph_view. The old module will be deleted in version 2.11.
WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.tracking.python_state has been moved to tensorflow.python.trackable.python_state. The old module will be deleted in version 2.11.
WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.saving.functional_saver has been moved to tensorflow.python.checkpoint.functional_saver. The old module will be deleted in version 2.11.
WARNING:tensorflow:Please fix your imports. Module tensorflow.python.training.saving.checkpoint_options has been moved to tensorflow.python.checkpoint.checkpoint_options. The old module will be deleted in version 2.11.

How to fix this?

update there

like image 245
Parcurcik Avatar asked Sep 07 '25 08:09

Parcurcik


2 Answers

To reduce the amount of warnings given by tensorflow all you need to do is define how much you want to avoid changing your os.environ variable here is a sample. 1 will make sure nothing is printed

import os.
import tensorflow as tf.
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
like image 115
INGl0R1AM0R1 Avatar answered Sep 11 '25 01:09

INGl0R1AM0R1


Can you try setting the log level before you import tensorflow?

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = "2"
import tensorflow as tf
like image 40
vijay m Avatar answered Sep 11 '25 00:09

vijay m