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

Error after trying to evaluate my RaResNet50 on pgd #7

Open
headscott opened this issue Jul 10, 2024 · 1 comment
Open

Error after trying to evaluate my RaResNet50 on pgd #7

headscott opened this issue Jul 10, 2024 · 1 comment

Comments

@headscott
Copy link

I trained a RaResNet50, by using make experiments/RaResNet50/.done_train

Afterwards, I wanted to evaluate it with make experiments/RaResNet50/.done_test_pgd, but it gave me this error:

Error executing job with overrides: ['train_test=test', '++name=RaResNet50', '++visualization.entity=', '++attack.train.eps=5', '++attack.test.eps=4', '++attack.test.eps=2', '++attack.test.gamma=1', '++attack.test.step=10', 'model=model', '++model.kwargs.depths=[5,8,13,1]', '++model.kwargs.stage_widths=[288,576,1120,2160]', '++model.kwargs.group_widths=[36,72,140,270]', '++model.kwargs.stem_downsample_factor=2', '++model.kwargs.strides.0=2', '++model.kwargs.stem_width=96', '++model.kwargs.se_ratio=0.25', '++model.kwargs.se_activation._target_=hydra.utils.get_class', '++model.kwargs.se_activation.path=torch.nn.ReLU', '++model.kwargs.activation_layer.0.path=torch.nn.SiLU', '++model.kwargs.activation_layer.1.path=torch.nn.SiLU', '++model.kwargs.activation_layer.2.path=torch.nn.SiLU', '++model.kwargs.norm_layer.0.path=torch.nn.Identity']
Traceback (most recent call last):
  File "/home/theiner/scripts/ModelleRobustbench/robust-principles/robustarch/main.py", line 107, in main
    train_loader, test_loader = get_datasets(cfg)
  File "/home/theiner/scripts/ModelleRobustbench/robust-principles/robustarch/utils.py", line 283, in get_datasets
    return get_imagenet(
  File "/home/theiner/scripts/ModelleRobustbench/robust-principles/robustarch/utils.py", line 260, in get_imagenet
    train_dataset = datasets.ImageFolder(root=train_path, transform=train_transform)
  File "/home/theiner/anaconda3/envs/ra-principles/lib/python3.9/site-packages/torchvision/datasets/folder.py", line 328, in __init__
    super().__init__(
  File "/home/theiner/anaconda3/envs/ra-principles/lib/python3.9/site-packages/torchvision/datasets/folder.py", line 149, in __init__
    classes, class_to_idx = self.find_classes(self.root)
  File "/home/theiner/anaconda3/envs/ra-principles/lib/python3.9/site-packages/torchvision/datasets/folder.py", line 234, in find_classes
    return find_classes(directory)
  File "/home/theiner/anaconda3/envs/ra-principles/lib/python3.9/site-packages/torchvision/datasets/folder.py", line 41, in find_classes
    classes = sorted(entry.name for entry in os.scandir(directory) if entry.is_dir())
FileNotFoundError: [Errno 2] No such file or directory: '../imagenet/train'

how can I fix it? Training just worked fine, so the path of ImageNet should be correct

@headscott
Copy link
Author

Okay I think I could fix it: I had to add ++dataset.data_dir="$(BASE)/imagenet" to TEST in the Makefile:

so from

TEST = cd $(SRC) && $(PYTHON) -m main train_test=test ++name=$(NAME) ++visualization.entity=$(WANDB_ACCOUNT)
to

TEST = cd $(SRC) && $(PYTHON) -m main train_test=test ++name=$(NAME) ++visualization.entity=$(WANDB_ACCOUNT) ++dataset.data_dir="$(BASE)/imagenet"

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