We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a torch ConcatDataset fails after running torchdrug.patch.py, so by extension every torchdrug import.
Minimal example:
from torch.utils.data import Dataset, ConcatDataset import torchdrug class DummyDataset(Dataset): def __init__(self, size=50): self.size=size def __len__(self): return self.size def __getitem__(self, idx): return idx dummy = ConcatDataset([DummyDataset(), DummyDataset()])
The issue appears to be caused by the following code snippet from patch.py
Dataset = dataset.Dataset for name, cls in inspect.getmembers(dataset): if inspect.isclass(cls) and issubclass(cls, Dataset): cls = core.make_configurable(cls) cls = R.register("dataset.%s" % name)(cls) patch(dataset, name, cls) importlib.reload(torch.utils.data)
Expected behavior: ConcatDataset is correctly initialised Actual behavior: Initialisation of ConcatDataset raises {TypeError}__init__() missing 1 required positional argument: 'datasets'
{TypeError}__init__() missing 1 required positional argument: 'datasets'
python version: 3.9.16 torch version: 1.13.1+cu117 torchdrug version: 0.2.1
The text was updated successfully, but these errors were encountered:
I'm encountering the same issue.
Sorry, something went wrong.
No branches or pull requests
Creating a torch ConcatDataset fails after running torchdrug.patch.py, so by extension every torchdrug import.
Minimal example:
The issue appears to be caused by the following code snippet from patch.py
Expected behavior: ConcatDataset is correctly initialised
Actual behavior: Initialisation of ConcatDataset raises
{TypeError}__init__() missing 1 required positional argument: 'datasets'
python version: 3.9.16
torch version: 1.13.1+cu117
torchdrug version: 0.2.1
The text was updated successfully, but these errors were encountered: