summaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2021-01-07 14:34:37 +0800
committerJordan Gong <jordan.gong@protonmail.com>2021-01-07 14:34:37 +0800
commita27af5dfd58e7b48cf3bd063fa2b4b51ed1e0277 (patch)
tree08e6b52d4e59506e6890bf67d1922abea97ce116 /config.py
parentf1fe77c083f952e81cf80c0b44611fc6057a7882 (diff)
Change device config and add enable multi-GPU computing
1. Add `disable_acc` switch for disabling accelerator. When it is off, system will automatically choosing accelerator. 2. Enable multi-GPU training using torch.nn.DataParallel
Diffstat (limited to 'config.py')
-rw-r--r--config.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/config.py b/config.py
index ad737e8..47ded38 100644
--- a/config.py
+++ b/config.py
@@ -1,12 +1,10 @@
-import torch
-
from utils.configuration import Configuration
config: Configuration = {
'system': {
- # Device(s) used in training and testing (CPU or CUDA)
- 'device': torch.device('cuda'),
- # GPU(s) used in training or testing, if CUDA enabled
+ # Disable accelerator
+ 'disable_acc': False,
+ # GPU(s) used in training or testing if available
'CUDA_VISIBLE_DEVICES': '0',
# Directory used in training or testing for temporary storage
'save_dir': 'runs',