-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix set visible devices #2174
Merged
Merged
fix set visible devices #2174
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Nic-Ma
reviewed
May 11, 2021
Signed-off-by: Richard Brown <[email protected]>
Nic-Ma
approved these changes
May 11, 2021
monai/data/test_time_augmentation.py
Outdated
@@ -89,7 +89,7 @@ def __init__( | |||
batch_size: int, | |||
num_workers: int, | |||
inferrer_fn: Callable, | |||
device: Optional[Union[str, torch.device]] = "cuda" if torch.cuda.is_available() else "cpu", | |||
device: Union[str, torch.device] = torch.device("cpu"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To solve the flake8 issue, maybe you can default to a str "cpu", like what we did for MONAI metrics:
https://github.com/Project-MONAI/MONAI/blob/dev/monai/handlers/iteration_metric.py#L51
Thanks.
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
yanielc
pushed a commit
to yanielc/MONAI
that referenced
this pull request
May 13, 2021
fix set visible devices Signed-off-by: Yaniel Cabrera <[email protected]>
yanielc
pushed a commit
to yanielc/MONAI
that referenced
this pull request
May 13, 2021
fix set visible devices Signed-off-by: Yaniel Cabrera <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2161.
Description
In TestTimeAugmentation, I called
torch.cuda
as a default argument to a constructor. This meant that the following code previously worked and now didn't:I fixed the problem and also created a unit test to avoid it happening in the future. The trick is that we shouldn't call
torch.cuda.
duringimport monai
.Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests
.make html
command in thedocs/
folder.