Open niniack opened 1 year ago
This was supposedly fixed in #1089, or at least this is mentioned there:
Dataloading in strategies now checks if the dataset has a "collate_fn" function and uses that unless one is specified through kwargs (which takes precedence).
But, my experience above doesn't align with it. Either way, #1089 seems relevant to the conversation.
This is definitely a bug. Can you submit a PR that properly adds collate_fn
to other_dataloader_args
? This should be the only needed change.
Should this fix be done through updating _obtain_common_dataloader_parameters
? Or is there another Avalanche style way of doing this? The hotfix of other_dataloader_args.update(kwargs)
doesn't seem very Avalanche-y (but maybe i'm wrong!!)
I will also write a test to check whether kwarg collate takes precedence over dataset collate.
Feel free to assign to me, thanks
I think updating _obtain_common_dataloader_parameters
is the best way.
Was this fixed in the meantime?
Describe the bug Calling
should respect all of the keyword arguments I pass in. In this case,
my_custom_collate
is discarded.To Reproduce For debugging, I define a custom strategy to examine what is passed into the dataloader. The make_train_dataloader function is lifted as it is from the 0.4.0 implementation
(Please note that I set breakpoints with
pdb
)Expected behavior
other_dataloader_args
should obey the kwargs and passmy_custom_collate
alongScreenshots
In the screenshot above
p kwargs
shows the custom collate function, but that does not show up inother_dataloader_args
which is what is passed ontoTaskBalancedDataLoader
Additional context
I cannot immediately think of why something like
other_dataloader_args.update(kwargs)
is a poor idea, would love to hear thoughts.