TensorFlow.js:如何避免“您的 CPU 支持指令...... AVX AVX2”?

Y.Z*_* X. 3 javascript tensorflow

环境:

  • 视窗 10 x64,
  • Node.js v10,
  • @tensorflow/tfjs-node v0.1.15

我正在尝试在 Node.js 上使用 tensorflow.js。

我安装了tfjs-node,它自动构建成功(node-gyp),但运行时收到以下错误:

tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

Python 版本中的类似问题可以在这里找到:

您的 CPU 支持此 TensorFlow 二进制文件未编译使用的指令:AVX AVX2

目前,我不关心性能,所以我只想禁用警告,不要启用 AVX/FMA。在 JavaScript 中,我该怎么办?

Y.Z*_* X. 7

运行前设置环境变量。

视窗:

$ set TF_CPP_MIN_LOG_LEVEL=2

Linux/MacOS:

$ export TF_CPP_MIN_LOG_LEVEL=2

  • 嗯嗯。这如何解决这个问题?看起来它只是阻止日志记录? (6认同)