Spaces:
Runtime error
Runtime error
Update BidirectionalTranslation/options/base_options.py
Browse files
BidirectionalTranslation/options/base_options.py
CHANGED
|
@@ -20,7 +20,7 @@ class BaseOptions():
|
|
| 20 |
parser.add_argument('--input_nc', type=int, default=1, help='# of input image channels') # Modified default
|
| 21 |
parser.add_argument('--output_nc', type=int, default=3, help='# of output image channels') # Modified default
|
| 22 |
parser.add_argument('--nz', type=int, default=64, help='#latent vector') # Modified default
|
| 23 |
-
parser.add_argument('--gpu_ids', type=str, default='
|
| 24 |
parser.add_argument('--name', type=str, default='color2manga_cycle_ganstft', help='name of the experiment') # Modified default
|
| 25 |
parser.add_argument('--preprocess', type=str, default='none', help='not implemented') # Modified default
|
| 26 |
parser.add_argument('--dataset_mode', type=str, default='aligned', help='aligned,single')
|
|
@@ -138,7 +138,7 @@ class BaseOptions():
|
|
| 138 |
id = int(str_id)
|
| 139 |
if id >= 0:
|
| 140 |
opt.gpu_ids.append(id)
|
| 141 |
-
if len(opt.gpu_ids) > 0:
|
| 142 |
torch.cuda.set_device(opt.gpu_ids[0])
|
| 143 |
|
| 144 |
self.opt = opt
|
|
|
|
| 20 |
parser.add_argument('--input_nc', type=int, default=1, help='# of input image channels') # Modified default
|
| 21 |
parser.add_argument('--output_nc', type=int, default=3, help='# of output image channels') # Modified default
|
| 22 |
parser.add_argument('--nz', type=int, default=64, help='#latent vector') # Modified default
|
| 23 |
+
parser.add_argument('--gpu_ids', type=str, default='-1', help='gpu ids: e.g. 0 0,1,2, 0,2, -1 for CPU mode')
|
| 24 |
parser.add_argument('--name', type=str, default='color2manga_cycle_ganstft', help='name of the experiment') # Modified default
|
| 25 |
parser.add_argument('--preprocess', type=str, default='none', help='not implemented') # Modified default
|
| 26 |
parser.add_argument('--dataset_mode', type=str, default='aligned', help='aligned,single')
|
|
|
|
| 138 |
id = int(str_id)
|
| 139 |
if id >= 0:
|
| 140 |
opt.gpu_ids.append(id)
|
| 141 |
+
if len(opt.gpu_ids) > 0 and torch.cuda.is_available():
|
| 142 |
torch.cuda.set_device(opt.gpu_ids[0])
|
| 143 |
|
| 144 |
self.opt = opt
|