gpt4 book ai didi

python - 如何抑制结果中显示的 Tensorflow 警告

转载 作者:太空狗 更新时间:2023-10-29 19:36:22 26 4
gpt4 key购买 nike

<分区>

我有一个与 Tensorflow 相关的 python 代码。它应该返回单个结果集。但是我得到下面提到的警告和结果。

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!

我将在此处放一小段 TensorFlow 代码。请让我知道如何抑制此警告。

注意:我是从 C# 调用这个 Python 文件。所以除了结果我不想显示任何东西。

代码片段:

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')

编辑:我也试过了,没用。

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com