Skip to content

Commit

Permalink
Merge pull request #100 from hzdr-MedImaging/fix-cuda-init
Browse files Browse the repository at this point in the history
remove obsolete cuda init which is performed in next if anyway.
  • Loading branch information
wolny authored Dec 4, 2023
2 parents a296dc9 + e39b51c commit 725ca3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion pytorch3dunet/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def main():
if torch.cuda.device_count() > 1 and not config['device'] == 'cpu':
model = nn.DataParallel(model)
logger.info(f'Using {torch.cuda.device_count()} GPUs for prediction')
model = model.cuda()
if torch.cuda.is_available() and not config['device'] == 'cpu':
model = model.cuda()

Expand Down
1 change: 0 additions & 1 deletion pytorch3dunet/unet3d/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def create_trainer(config):
if torch.cuda.device_count() > 1 and not config['device'] == 'cpu':
model = nn.DataParallel(model)
logger.info(f'Using {torch.cuda.device_count()} GPUs for prediction')
model = model.cuda()
if torch.cuda.is_available() and not config['device'] == 'cpu':
model = model.cuda()

Expand Down

0 comments on commit 725ca3a

Please sign in to comment.