WARNING: Tensorflow: switch to tf.summary.scalar. Note that tf.summary.scalar uses node name instead of tag
following codes from tensorflow get_started
Getting started with TensorFlow
when i run Pycharm many warnings appear, setting the TF_CPP_MIN_LOG_LEVEL environment variable to 2 or 3 doesn't work;
IDE: PyCharm Community Edition 2017.1 Build # PC-171.3780.115, built on March 24, 2017 JRE: 1.8.0_112-release-736-b13 amd64 JVM: 64-bit OpenJDK VM by JetBrains sro Linux 4.4.0-62-general
System: Linux Muse 4.4.0-62-generi # 83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU / Linux
Tensorflow : 1.1.0-rc0 with Anaconda Python 3.6.0
I just want to close this warning or another method might fix it, it's boring.
import tensorflow as tf
import numpy as np
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
features = [tf.contrib.layers.real_valued_column("x", dimension=1)]
estimator = tf.contrib.learn.LinearRegressor(feature_columns=features)
x = np.array([1., 2., 3., 4.])
y = np.array([0., -1., -2., -3.])
input_fn = tf.contrib.learn.io.numpy_input_fn({"x":x}, y, batch_size=4,
num_epochs=1000)
estimator.fit(input_fn=input_fn, steps=1000)
print(estimator.evaluate(input_fn=input_fn))
WARNING: tensorflow: using temp folder as model directory: / tmp / tmpr_l0viod
WARNING: Tensor flow: The rank of the input Tensor (1) must be the same as the output_rank (2) for the column. Will try to expand dims. It is highly recommended to resize the input as this may change.
WARNING: tensorflow: From / home / zhengql / anaconda3 / envs / tensorflow / lib / python3.6 / site-packages / tensorflow / contrib / learn / python / learn / estimators / head.py: 615: scalar_summary (from tensorflow.python .ops.logging_ops) is deprecated and will be removed after 2016-11-30. Upgrade instructions: Go to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically deduce the resulting names based on the scope in which they are created. Also, passing a tensor or tag list to a scalar summary op is no longer supported.
WARNING: Tensor flow: The rank of the input Tensor (1) must be the same as the output_rank (2) for the column. Will try to expand dims. It is highly recommended to resize the input as this may change.
WARNING: tensorflow: From / home / zhengql / anaconda3 / envs / tensorflow / lib / python3.6 / site-packages / tensorflow / contrib / learn / python / learn / estimators / head.py: 615: scalar_summary (from tensorflow.python .ops.logging_ops) is deprecated and will be removed after 2016-11-30. Upgrade instructions: Go to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically deduce the resulting names based on the scope in which they are created. Also, passing a tensor or tag list to a scalar summary op is no longer supported.
WARNING: Tensorflow: Skip summary for global_step, must be float or np.float32. {'loss': 2.1558171e-07, 'global_step': 1000}
source to share
No one has answered this question yet
Check out similar questions: