-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Test time augmentations #1794
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
Test time augmentations #1794
Conversation
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
|
requires #1795. |
monai/data/test_time_augmentation.py
Outdated
| batch_output = torch.Tensor(batch_output) | ||
|
|
||
| # check binary labels are extracted | ||
| if not all(torch.unique(batch_output.int()) == torch.Tensor([0, 1])): |
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.
This class will only work with segmentation networks then? Could it theoretically make sense for other tasks like image-to-image transformation? The returned values may make less sense perhaps.
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.
I've removed the check. We have the return_full_data if the user doesn't want to use the default metrics (e.g., computing the mode probably doesn't make sense for floating point numbers).
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
|
@wyli do you think you could provide some insight into this error? I can't see how any of the files I've modified could cause this. Also I'm getting a flake error. This comes from: if isinstance(transform, Compose):
# call recursively for each sub-transform
return any(is_transform_rand_invertible(t) for t in transform.transforms)When the if statement is satisfied, transform must therefore be of type |
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
|
Hi @rijobro for the first error, I think it's because to replicate the issue in a system without ignite: |
|
I couldn't replicate the pytype error either... perhaps have a |
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
|
@wyli ok so the ignite must be because I'm importing |
agreed, I think they are generic properties. cc @Nic-Ma |
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
|
Hi @wyli, current tests are failing: https://github.com/Project-MONAI/MONAI/pull/1794/checks?check_run_id=2169625488#step:11:5093. But device is set with |
strange, how do I get the corresponding code of that log? |
|
Don't think you can do it from the logs, but you can obviously get it from the changed files in the PR. Here's the problematic |
the log corresponds to 6b488c https://github.com/Project-MONAI/MONAI/pull/1794/checks?check_run_id=2169625488#step:3:472 which is the commit before this device update, and the latest test doesn't show the error, correct? |
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
wyli
left a comment
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.
thanks!
| # check that whenever randoms is True, invertibles is also true | ||
| for r, i in zip(randoms, invertibles): | ||
| if r and not i: | ||
| raise RuntimeError( |
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.
this could be a warning because the random factors may be in the model, we may want to do test aug with a randomised model...
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
This reverts commit bb2e141. Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
Test time augmentations.
closes #718
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.make htmlcommand in thedocs/folder.