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
While using the torchvision.datasets.ImageFolder I get an error:
You have to pass data to augmentations as named arguments, for example: aug(image=image)
This is because the ImageFolder uses:
...
if self.transform is not None:
sample = self.transform(sample)
...
from torchvision/datasets/folder.py.
Is is correct to create an issue here?
Traceback
KeyError Traceback (most recent call last)
<ipython-input-50-60c394f66b5b> in <module>
----> 1 model_ft = train_model(mobilenet_v3_large, criterion, optimizer_ft, exp_lr_scheduler,
2 num_epochs=25)
<ipython-input-38-1a5d4f162548> in train_model(model, criterion, optimizer, scheduler, num_epochs)
20
21 # Iterate over data.
---> 22 for inputs, labels in dataloaders[phase]:
23 inputs = inputs.to(device)
24 labels = labels.to(device)
~/.local/lib/python3.9/site-packages/torchvision/datasets/folder.py in __getitem__(self, index)
178 sample = self.loader(path)
179 if self.transform is not None:
180 sample = self.transform(sample)
181 if self.target_transform is not None:
182 target = self.target_transform(target)
~/.local/lib/python3.9/site-packages/albumentations/core/composition.py in __call__(self, force_apply, *args, **data)
163 def __call__(self, *args, force_apply=False, **data):
164 if args:
165 raise KeyError("You have to pass data to augmentations as named arguments, for example: aug(image=image)")
166 self._check_args(**data)
167 assert isinstance(force_apply, (bool, int)), "force_apply must have bool or int type"
KeyError: 'You have to pass data to augmentations as named arguments, for example: aug(image=image)'
Expected behavior
Should work while training.
Environment
Albumentations version: 0.5.2
Python version: 3.9
OS: Linux
How you installed albumentations (conda, pip, source): pip
The text was updated successfully, but these errors were encountered:
🐛 Bug
While using the
torchvision.datasets.ImageFolder
I get an error:This is because the ImageFolder uses:
from
torchvision/datasets/folder.py
.Is is correct to create an issue here?
Traceback
Expected behavior
Should work while training.
Environment
conda
,pip
, source): pipThe text was updated successfully, but these errors were encountered: