Skip to content
New issue

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

'CIFAR10Anom' object has no attribute 'class_to_idx' #1

Open
MlLearnerAkash opened this issue Mar 14, 2022 · 0 comments
Open

'CIFAR10Anom' object has no attribute 'class_to_idx' #1

MlLearnerAkash opened this issue Mar 14, 2022 · 0 comments

Comments

@MlLearnerAkash
Copy link

MlLearnerAkash commented Mar 14, 2022

To,
The concerned ones ,
I was running the repository for cifar10 dataset , in the data.py file it is popping up an error in the line 30.
The issue says ,the very class "CIFAR10Anom" class does not have any 'class_to_idx' attribute .

How to get rid of this ???

I quote the whole error below :

wandb: Run data is saved locally in /home/genie/AMA/AMA/wandb/run-20220314_143815-2ey9xmj1
wandb: Run wandb offline to turn off syncing.

Chosen Seed: 5
Namespace(abnormal_classes=None, ae_recon_loss_type='wasserstein', anom_metric_type='f_anomloss', anom_pc=0.1, anom_recon_lambda=5.0, atyp_ratio=0.5, atyp_selec_style='inward', augment=False, batchsize=256, ch=128, corrup=False, corruption=0, cuda=0, dataroot='./data/CIFAR10/', dataset='cifar10', expt_name='cifar_experiments', gp_lambda=10, image_size=32, interpolation_in_recon=False, ip_lambda=0.2, learning_setting='ss', lr=0.0003, manualSeed=5, model_load_path='', ngpu=1, normal_class="['ship']", num_channels=3, num_epochs=100, nz=128, ood_model=False, recon_loss_type='wasserstein', regularizer_lambda=1.0, sampling=True, save_logs_epochs=1, save_model_epochs=30, save_model_root='logs', spectral_norm=1, start=0, update_ratio=5, use_penalty=True, val_split=0.05, workers=4)
Files already downloaded and verified
Traceback (most recent call last):
File "train.py", line 175, in
dataset_train, dataset_valid, dataset_test = data.load_data(dataset = opt.dataset, ood = opt.ood_model, anom_classes = anom_classes,anom_ratio=opt.anom_pc,corruption= opt.corruption, seed = opt.manualSeed, augmentation = opt.augment, learning_setting= opt.learning_setting, valid_split = opt.val_split)
File "/home/genie/AMA/AMA/data.py", line 237, in load_data
dataset_train = CIFAR10Anom(root=root,stage='train',
File "/home/genie/AMA/AMA/data.py", line 30, in init
if len(set(anom_classes) & set(self.class_to_idx.keys()))==0:
AttributeError: 'CIFAR10Anom' object has no attribute 'class_to_idx'
Traceback (most recent call last):
File "train.py", line 175, in
dataset_train, dataset_valid, dataset_test = data.load_data(dataset = opt.dataset, ood = opt.ood_model, anom_classes = anom_classes,anom_ratio=opt.anom_pc,corruption= opt.corruption, seed = opt.manualSeed, augmentation = opt.augment, learning_setting= opt.learning_setting, valid_split = opt.val_split)
File "/home/genie/AMA/AMA/data.py", line 237, in load_data
dataset_train = CIFAR10Anom(root=root,stage='train',
File "/home/genie/AMA/AMA/data.py", line 30, in init
if len(set(anom_classes) & set(self.class_to_idx.keys()))==0:
AttributeError: 'CIFAR10Anom' object has no attribute 'class_to_idx'

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant