Closed sakvaua closed 1 week ago
Hi @sakvaua, based on the error message, it seems the issue arises from a dtype mismatch after the random transformation. To resolve this, you can include EnsureTyped
after the OneOf
transform to ensure the data has the correct dtype.
EnsureTyped(keys=["image", "label"], dtype=[torch.float32, torch.uint8])
Hope it helps, thanks. (Move to discussion for now)
I'm new to MONAI and could be doing something wrong but for some unclear reason, my dataloader fails if I include OneOf transform. It only fails if I use multiprocessing (num_workers in Dataloader>0). Everything works fine If I apply all the transforms included in the OneOf without the wrapper.
To Reproduce Here is a minimum working example
Expected behavior I expect the code not to fail at all or at least fail in both cases.
Ensuring you use the relevant python executable, please paste the output of: