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
But when I reworked my transformations, I noticed, that get_subjects_from_batch has problems with metadata. It seems to discard it entirely. In addition int-values (like age) even cause get_subjects_from_batch to crash!
I don't know if I'm using SubjectsDataset.from_batch wrong, but at first sight this looks like a bug to me.
I'll add a PR with two failing test-cases.
As I'm unsure what the intended behavior is, I'll wait for your feedback before I take a deeper look at the code myself.
AssertionError on test_subjects_from_batch_with_string_metadata
RuntimeError on test_subjects_from_batch_with_int_metadata
Error messages
RuntimeError: Tensor.__contains__ only supports Tensor or scalar, but you passed in a <class 'str'>.AssertionError: assert 'name' in Subject(Keys: ('label',); images: 1)
Expected outcome
The original subject from the first line of each test
Is there an existing issue for this?
Bug summary
Hello Fernando,
I discovered a little bug last week.
The documentation suggests adding metadata to my subjects, like a name and an age https://torchio.readthedocs.io/data/subject.html And it works nicely!
But when I reworked my transformations, I noticed, that
get_subjects_from_batch
has problems with metadata. It seems to discard it entirely. In addition int-values (like age) even causeget_subjects_from_batch
to crash!I don't know if I'm using
SubjectsDataset.from_batch
wrong, but at first sight this looks like a bug to me.I'll add a PR with two failing test-cases.
As I'm unsure what the intended behavior is, I'll wait for your feedback before I take a deeper look at the code myself.
Regards,
Max
Code for reproduction
Actual outcome
AssertionError on test_subjects_from_batch_with_string_metadata
RuntimeError on test_subjects_from_batch_with_int_metadata
Error messages
Expected outcome
The original subject from the first line of each test
System info
The text was updated successfully, but these errors were encountered: