Commit 4d33715d authored by Yuxin Wu's avatar Yuxin Wu

better eval

parent a1d1a4ae
......@@ -206,7 +206,7 @@ def eval_model_multiprocess(model_path, romfile):
self.outq.put(tot_reward)
tot_reward = 0
NR_PROC = multiprocessing.cpu_count() // 2
NR_PROC = min(multiprocessing.cpu_count() // 2, 10)
procs = []
q = multiprocessing.Queue()
for k in range(NR_PROC):
......
......@@ -116,6 +116,7 @@ class ParallelPredictWorker(multiprocessing.Process):
os.environ['CUDA_VISIBLE_DEVICES'] = self.gpuid
else:
logger.info("Worker {} uses CPU".format(self.idx))
os.environ['CUDA_VISIBLE_DEVICES'] = ''
G = tf.Graph() # build a graph for each process, because they don't need to share anything
with G.as_default(), tf.device('/gpu:0' if self.gpuid >= 0 else '/cpu:0'):
if self.idx != 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment