giotto-ai / giotto-deep

Deep learning made topological.
Other
79 stars 11 forks source link

[BUG] Using torchvision's root parameter through DatasetBuilder causes error #126

Closed AnthoJack closed 1 year ago

AnthoJack commented 1 year ago

Describe the bug When using giotto's DatasetBuilder to build a torchvision dataset (CIFAR, caltechXXX, ...), providing a custom "root" argument for the Pytorch dataset causes an error: "TypeError: type object got multiple values for keyword argument 'root'". This is due to the fact that the DatasetBuilder already tries to provide a default root folder

To reproduce Try to use the DatasetBuilder as per the following code to create any dataset from the torchvision collection

caltech_bd = DatasetBuilder("Caltech256")
caltech_ds, _, _ = caltech_bd.build(root="~/customFolder")

Expected behavior The documentation specifies that the kwargs in the "build" method can be used to transfer arguments to the torchvision dataset but nowhere is it mentioned that the "root" argument should not be used. As such, trying to use it should not result in an error

Actual behaviour The aforementioned error is raised