poudel commited on
Commit
e08ba6b
1 Parent(s): 24f47e0

Create setup_environment.py

Browse files
Files changed (1) hide show
  1. setup_environment.py +12 -0
setup_environment.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import tensorflow as tf
3
+ import logging
4
+
5
+ # Disable oneDNN custom operations if needed
6
+ os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
7
+
8
+ # Disable GPU usage (force TensorFlow to use CPU)
9
+ os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
10
+
11
+ # Suppress TensorFlow warnings and logs
12
+ tf.get_logger().setLevel(logging.ERROR)