Code Monkey home page Code Monkey logo

ama's Issues

'CIFAR10Anom' object has no attribute 'class_to_idx'

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.