Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning while using tensorflow : tensorflow/core/util/port.cc:113] oneDNN custom operations are on

When using tensorflow, I get this warning

import tensorflow
 tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.

I tried to change the environmental variable to 0 by set TF_ENABLE_ONEDNN_OPTS=0. But still the issue persists.

like image 370
Jegadeesh Avatar asked Sep 13 '25 06:09

Jegadeesh


2 Answers

import os

os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'

import keras

It should work then without issues, at least for me it worked!

like image 185
Kevin Ball Avatar answered Sep 14 '25 20:09

Kevin Ball


Question 1:

tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0

Solutions:

1.

import os
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'

import tensorflow as tf
  1. export TF_ENABLE_ONEDNN_OPTS=0;

Here, TF_ENABLE_ONEDNN_OPTS=0 should be above import tensorflow as tf as shown above.

Question 2:

To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

Solutions:

1.

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

import tensorflow as tf
  1. export TF_CPP_MIN_LOG_LEVEL=2

Here, TF_CPP_MIN_LOG_LEVEL=2 should be above import tensorflow as tf as shown above.

like image 38
Punit Tiwari Avatar answered Sep 14 '25 20:09

Punit Tiwari