运行tensorflow是出现的问题This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU

    科技2024-06-30  67

    2020-10-07 15:19:48.552933: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2020-10-07 15:19:48.580650: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x266acc7ce50 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2020-10-07 15:19:48.581864: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version

    翻译一下:

    根据我目前查到的资料,

    这个TensorFlow二进制文件使用Intel® mkl - dnn进行了优化,以便在性能关键操作中使用以下CPU指令:AVX AVX2

    要在非mkl - dnn操作中启用它们,请使用适当的编译器标志重新构建TensorFlow

    说白了就是tensorflow安装的不对,不是版本问题,而是需要从源代码安装tensorflow

    一种解决方法,就是忽略 import os os.environ[‘TF_CPP_MIN_LOG_LEVEL’] = ‘2’

    Processed: 0.012, SQL: 8