You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there,
I recently updated torch from version <2.3 to 2.5 and a new warning appeared in my stdout: UserWarning: Using TorchIO images without a torchio.SubjectsLoader in PyTorch >= 2.3 might have unexpected consequences, e.g., the collated batches will be instances of torchio.Subject with 5D images. Replace your PyTorch DataLoader with a torchio.SubjectsLoader so that the collated batch becomes a dictionary, as expected. See https://github.com/fepegar/torchio/issues/1179 for more context about this issue.
So as suggested, I changed my DataLoader to SubjectLoader, but the warning did not disappear.
So I delved deeper and found that Queue creates a DataLoader, which causes the message above.
I am not sure if this is something intended or if there is maybe something wrong with the way I used Queue and SubjectLoader in my code. As Queue used directly a DataLoader, it is unclear how I can fix this error message.
When I iterate through the subjectloader, I get a dict as expected and everything still works as before.
I also noticed that in_torch_loader() is not extremely fast (still not a bottleneck for sure in my code), maybe a way to disable it would be helpful?
Multiple warnings (i guess one for each num_workers): UserWarning: Using TorchIO images without a torchio.SubjectsLoader in PyTorch >= 2.3 might have unexpected consequences, e.g., the collated batches will be instances of torchio.Subject with 5D images. Replace your PyTorch DataLoader with a torchio.SubjectsLoader so that the collated batch becomes a dictionary, as expected. See https://github.com/fepegar/torchio/issues/1179 for more context about this issue.
Error messages
`UserWarning: Using TorchIO images without a torchio.SubjectsLoader in PyTorch >= 2.3 might have unexpected consequences, e.g., the collated batches will be instances of torchio.Subject with 5D images. Replace your PyTorch DataLoader with a torchio.SubjectsLoader so that the collated batch becomes a dictionary, as expected. See https://github.com/fepegar/torchio/issues/1179 for more context about this issue.`
Is there an existing issue for this?
Problem summary
Hello there,
I recently updated torch from version <2.3 to 2.5 and a new warning appeared in my stdout:
UserWarning: Using TorchIO images without a torchio.SubjectsLoader in PyTorch >= 2.3 might have unexpected consequences, e.g., the collated batches will be instances of torchio.Subject with 5D images. Replace your PyTorch DataLoader with a torchio.SubjectsLoader so that the collated batch becomes a dictionary, as expected. See https://github.com/fepegar/torchio/issues/1179 for more context about this issue.
So as suggested, I changed my
DataLoader
toSubjectLoader
, but the warning did not disappear.So I delved deeper and found that
Queue
creates aDataLoader
, which causes the message above.torchio/src/torchio/data/queue.py
Line 359 in 9051dbc
My code is nearly the same as the example on the docs page: https://torchio.readthedocs.io/patches/patch_training.html
I have also attached the code below in case I missed something important.
I am not sure if this is something intended or if there is maybe something wrong with the way I used Queue and SubjectLoader in my code. As Queue used directly a DataLoader, it is unclear how I can fix this error message.
When I iterate through the subjectloader, I get a dict as expected and everything still works as before.
I also noticed that
in_torch_loader()
is not extremely fast (still not a bottleneck for sure in my code), maybe a way to disable it would be helpful?Thanks!
Code for reproduction
Actual outcome
Multiple warnings (i guess one for each num_workers):
UserWarning: Using TorchIO images without a torchio.SubjectsLoader in PyTorch >= 2.3 might have unexpected consequences, e.g., the collated batches will be instances of torchio.Subject with 5D images. Replace your PyTorch DataLoader with a torchio.SubjectsLoader so that the collated batch becomes a dictionary, as expected. See https://github.com/fepegar/torchio/issues/1179 for more context about this issue.
Error messages
Expected outcome
I would expect the warning to disappear
System info
The text was updated successfully, but these errors were encountered: