marco-rudolph / differnet

This is the official repository to the WACV 2021 paper "Same Same But DifferNet: Semi-Supervised Defect Detection with Normalizing Flows" by Marco Rudolph, Bastian Wandt and Bodo Rosenhahn.
217 stars 68 forks source link

AttributeError: 'ImageFolderMultiTransform' object has no attribute '_find_classes' #32

Closed volkov-maxim closed 3 years ago

volkov-maxim commented 3 years ago

Hi! When I ran main.py I got runtime error:

py main.py Traceback (most recent call last): File "C:\Projects\bricky\defect_detection\differnet\main.py", line 10, in train_set, test_set = load_datasets(c.dataset_path, c.class_name) File "C:\Projects\bricky\defect_detection\differnet\utils.py", line 104, in load_datasets trainset = ImageFolderMultiTransform(data_dir_train, transform=transform_train, n_transforms=c.n_transforms) File "C:\Projects\bricky\defect_detection\differnet\multi_transform_loader.py", line 67, in init super(ImageFolderMultiTransform, self).init(root, loader, IMG_EXTENSIONS, File "C:\Projects\bricky\defect_detection\differnet\multi_transform_loader.py", line 34, in init classes, class_to_idx = self._find_classes(self.root) AttributeError: 'ImageFolderMultiTransform' object has no attribute '_find_classes'

I think that this error causes due the typo in "differnet\multi_transform_loader.py" (line 34). DatasetFolder object haven't _find_classes method, instead of it has find_classes method.

marco-rudolph commented 3 years ago

29

For the new torchvision version, use classes, class_to_idx = self.find_classes(self.root)

marco-rudolph commented 3 years ago

Thanks for the hint, I will do a commit where it works with both torchvision versions.

volkov-maxim commented 3 years ago

Sorry for duplicate 😏

marco-rudolph commented 3 years ago

no problem - you can say the subject of the old issue was not helpful at all...