Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n_gpu = 4
- if(n_gpu == 1):
- self._build_model()
- self._build_train_op()
- else:
- # 1 GPU for training, n-1 for playing
- if(self.id <= 3):
- gpu_id = 0
- else:
- gpu_id = (1 + (self.id%(n_gpu-1)))
- os.environ["CUDA_VISIBLE_DEVICES"]=str(gpu_id)
- self._build_model()
- self._build_train_op()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement