Skip to content
Snippets Groups Projects
Commit 64acbc93 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Set environment variable to map the devices

parent 5bd29a11
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ from tensorflow.core.framework import summary_pb2 ...@@ -14,6 +14,7 @@ from tensorflow.core.framework import summary_pb2
import time import time
from bob.learn.tensorflow.datashuffler.OnlineSampling import OnLineSampling from bob.learn.tensorflow.datashuffler.OnlineSampling import OnLineSampling
os.environ["CUDA_VISIBLE_DEVICES"] = "1,2,3,0"
logger = bob.core.log.setup("bob.learn.tensorflow") logger = bob.core.log.setup("bob.learn.tensorflow")
...@@ -276,7 +277,9 @@ class Trainer(object): ...@@ -276,7 +277,9 @@ class Trainer(object):
# Training # Training
hdf5 = bob.io.base.HDF5File(os.path.join(self.temp_dir, 'model.hdf5'), 'w') hdf5 = bob.io.base.HDF5File(os.path.join(self.temp_dir, 'model.hdf5'), 'w')
with tf.Session() as session: config = tf.ConfigProto(log_device_placement=True)
config.gpu_options.allow_growth = True
with tf.Session(config=True) as session:
tf.initialize_all_variables().run() tf.initialize_all_variables().run()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment