Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

528
Views
How to Suppress Tensorflow warning displayed in result

I have a python code connected with Tensorflow. It is supposed to return single result set. But i'm getting below mentioned warning along with result.

WARNING:tensorflow:From C:\Users\vsureshx079451\AppData\Local\Programs\Python\Python36\lib\site-packages\tflearn\objectives.py:66: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead 2018-02-04 19:12:04.860370: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

Result Here!

I will just put a small snippet of TensorFlow code here. Please let me know how to suppress this warning.

Note: I'm calling this Python file from C#. So i dont want to display anything other than result.

Code Snippet:

self.words = data['words']
        self.classes = data['classes']
        train_x = data['train_x']
        train_y = data['train_y']
        with open('intents.json') as json_data:
            self.intents = json.load(json_data)
        #input("Press Enter to continue...")
        tf.reset_default_graph()
        net = tflearn.input_data(shape=[None, len(train_x[0])])
        net = tflearn.fully_connected(net, 8)
        net = tflearn.fully_connected(net, 8)
        net = tflearn.fully_connected(net, len(train_y[0]), activation='softmax')
        net = tflearn.regression(net)
        # Define model and setup tensorboard
        self.model = tflearn.DNN(net, tensorboard_dir='tflearn_logs')

Edit: I tried this as well, it didn't work.

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

After searching hours together i found answer from Stackoverflow itself, where the answer is provided for different issue. And that solution worked here as well.

Here is the solution for TF 1.x:

tf.logging.set_verbosity(tf.logging.ERROR)

For TF 2.x:

tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)

Source: Is there a way to suppress the messages TensorFlow prints?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!