Closed mayank010698 closed 1 year ago
Facing the same problem...Any methods so far?
I copied the following line in the load_cifar10c
function:
https://github.com/RobustBench/robustbench/blob/ec26a6cd0b0812135270c3659caabcab80701b15/robustbench/data.py#L254
I copied the following line in the
load_cifar10c
function:
Sorry I don't get it, I know that the original version is:
def load_cifar10c(
n_examples: int,
severity: int = 5,
data_dir: str = './data',
shuffle: bool = False,
corruptions: Sequence[str] = CORRUPTIONS,
_: Callable = PREPROCESSINGS[None]
) -> Tuple[torch.Tensor, torch.Tensor]:
return load_corruptions_cifar(BenchmarkDataset.cifar_10, n_examples,
severity, data_dir, corruptions, shuffle)
And it would return an Error, could you please tell me how exactly your method works? I would really appreciate it
Where should I copy it since there's no definition of
Replace this line https://github.com/RobustBench/robustbench/blob/ec26a6cd0b0812135270c3659caabcab80701b15/robustbench/data.py#L309
and instead for data_root_dir use
Path(data_dir) / CORRUPTIONS_DIR_NAMES[ BenchmarkDataset.cifar10[ThreatModel.corruptions] / corruptions[0] / str(severity)
or something similar
Replace this line
and instead for data_root_dir use
Path(data_dir) / CORRUPTIONS_DIR_NAMES[ BenchmarkDataset.cifar10[ThreatModel.corruptions] / corruptions[0] / str(severity)
or something similar
Sorry Im still so confused, first of all I need to copy one line of code in
data_folder_path = Path(data_dir) / CORRUPTIONS_DIR_NAMES[
BenchmarkDataset.imagenet][ThreatModel.corruptions] / corruptions[0] / str(severity)
this line since I don't know why it would work, and why replace 'this' line when you quoted a definition line of the
Hi! This should have been solved in #144, thanks to @craymichael's contribution. Let us know if you still face the issue!
When I run the example code,
corruptions = ['fog']
x_test, y_test = load_cifar10c(n_examples=1000, corruptions=corruptions, severity=5)
I get the error,
File "/projects/dali/mayanks4/TPGM-CIFAR10/DomainNet_ResNet_Exp/robustbench/data.py", line 323, in load_corruptions_cifar data_root_dir = data_dir / CORRUPTIONS_DIR_NAMES[dataset] TypeError: unsupported operand type(s) for /: 'PosixPath' and 'dict'