Skip to content

Commit 725ca3a

Browse files
authored
Merge pull request #100 from hzdr-MedImaging/fix-cuda-init
remove obsolete cuda init which is performed in next if anyway.
2 parents a296dc9 + e39b51c commit 725ca3a

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

pytorch3dunet/predict.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def main():
3838
if torch.cuda.device_count() > 1 and not config['device'] == 'cpu':
3939
model = nn.DataParallel(model)
4040
logger.info(f'Using {torch.cuda.device_count()} GPUs for prediction')
41-
model = model.cuda()
4241
if torch.cuda.is_available() and not config['device'] == 'cpu':
4342
model = model.cuda()
4443

pytorch3dunet/unet3d/trainer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def create_trainer(config):
2323
if torch.cuda.device_count() > 1 and not config['device'] == 'cpu':
2424
model = nn.DataParallel(model)
2525
logger.info(f'Using {torch.cuda.device_count()} GPUs for prediction')
26-
model = model.cuda()
2726
if torch.cuda.is_available() and not config['device'] == 'cpu':
2827
model = model.cuda()
2928

0 commit comments

Comments
 (0)