Skip to content
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

Lazy=True ignored when using Dataset call #6974

Closed
KumoLiu opened this issue Sep 13, 2023 · 0 comments · Fixed by #6975
Closed

Lazy=True ignored when using Dataset call #6974

KumoLiu opened this issue Sep 13, 2023 · 0 comments · Fixed by #6975
Assignees
Labels
bug Something isn't working

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Sep 13, 2023

Describe the bug
Dataset call, lazy=True ignored

To Reproduce

import monai.transforms as mt
from monai.data import Dataset

d = {"image": "tests/testing_data/ref_avg152T1_LR.nii.gz"}
xform = mt.Compose(
    [
        mt.LoadImaged(keys="image"),
        mt.RandAffined(keys="image", prob=1.0, rotate_range=45.0, translate_range=10.0, scale_range=0.15),
    ],
    lazy=True,
    log_stats=True,
)
out_1 = xform(d)  # direct call works fine

x = Dataset([d], transform=xform)  # dataset call, lazy=True ignored
out_2 = x[0]
@KumoLiu KumoLiu added the bug Something isn't working label Sep 13, 2023
@KumoLiu KumoLiu self-assigned this Sep 13, 2023
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Sep 13, 2023
Signed-off-by: KumoLiu <[email protected]>
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Sep 13, 2023
Signed-off-by: KumoLiu <[email protected]>
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Sep 13, 2023
wyli pushed a commit that referenced this issue Sep 13, 2023
Fixes #6974.

### Description
Change default value of `lazy` in `apply_transform` to None.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: KumoLiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant