我试图在Ubuntu上安装tensorflow,却收到了这条消息:
(base) k@k-1005:~/Documents/ClassificationTexte/src$ python tester.py
Using TensorFlow backend.
RUN: 1
1.1. Training the classifier...
LABELS: {'negative', 'neutral', 'positive'}
2019-12-10 11:58:13.428875: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags.
2019-12-10 11:58:13.432727: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3190585000 Hz
2019-12-10 11:58:13.433041: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5591c387b750 executing computations on platform Host. Devices:
2019-12-10 11:58:13.433098: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version
2019-12-10 11:58:13.433182: I tensorflow/core/common_runtime/process_util.cc:115] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
Model: "model_1"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input_1 (InputLayer) (None, 8000) 0
_________________________________________________________________
dense_1 (Dense) (None, 3) 24003
但是脚本可以工作并显示准确性,但上面的这部分在运行之前显示。你有什么想法吗,我在蟒蛇上安装了张量流:
如果您不想看到这些错误,请在运行脚本之前使用它
export TF_CPP_MIN_LOG_LEVEL=2
或
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
在脚本中。
您的CPU支持此TensorFlow二进制文件未编译使用的指令:AVX AVX2
更新:在您的代码中使用一种更简洁的方式:< code>tf.get_logger()。setLevel('ERROR')
抛出上述警告是因为TensorFlow
库最初是在不同的架构机器上编译的,并且没有针对您的特定架构进行优化。这意味着它将继续运行,但您不会从库中获得最大性能。
为了在机器上获得最大性能,您需要在机器上构建TensorFlow。
关于从源代码构建的步骤,请参考官方文档。
官方文档:https://www.tensorflow.org/install/source