Closed hooxizz closed 1 year ago
Hi there,
I try to load all corruptions of Imagenet-C as below: from robustbench.data import load_imagenetc
from robustbench.data import load_imagenetc
corruptions = ['gaussian_noise', 'shot_noise', 'impulse_noise', 'defocus_blur', 'glass_blur', 'motion_blur', 'zoom_blur', 'snow', 'frost', 'fog', 'brightness', 'contrast', 'elastic_transform', 'pixelate', 'jpeg_compression']
corruptions = ['gaussian_noise', 'shot_noise', 'impulse_noise',
'defocus_blur', 'glass_blur', 'motion_blur', 'zoom_blur',
'snow', 'frost', 'fog', 'brightness',
'contrast', 'elastic_transform', 'pixelate', 'jpeg_compression']
x_test_all = [] y_test_all = []
x_test_all = []
y_test_all = []
for i_c, corruption_type in enumerate(corruptions): # continual adaptation for all corruption print('load:', corruption_type) x_test, y_test = load_imagenetc(n_examples=5000, severity=5, data_dir='./data', shuffle=False, corruptions=[corruption_type]) # x_test, y_test = x_test.cuda(), y_test.cuda() x_test_all.append(x_test) y_test_all.append(y_test)
for i_c, corruption_type in enumerate(corruptions):
# continual adaptation for all corruption
print('load:', corruption_type)
x_test, y_test = load_imagenetc(n_examples=5000,
severity=5, data_dir='./data', shuffle=False,
corruptions=[corruption_type])
# x_test, y_test = x_test.cuda(), y_test.cuda()
x_test_all.append(x_test)
y_test_all.append(y_test)
However, I got the error and set num_workers=0 is useless. RuntimeError: DataLoader worker (pid(s) 29578) exited unexpectedly
num_workers=0
RuntimeError: DataLoader worker (pid(s) 29578) exited unexpectedly
Do you have any suggestions? Thanks in advance.
Hi there,
I try to load all corruptions of Imagenet-C as below:
from robustbench.data import load_imagenetc
corruptions = ['gaussian_noise', 'shot_noise', 'impulse_noise',
'defocus_blur', 'glass_blur', 'motion_blur', 'zoom_blur',
'snow', 'frost', 'fog', 'brightness',
'contrast', 'elastic_transform', 'pixelate', 'jpeg_compression']
x_test_all = []
y_test_all = []
for i_c, corruption_type in enumerate(corruptions):
# continual adaptation for all corruption
print('load:', corruption_type)
x_test, y_test = load_imagenetc(n_examples=5000,
severity=5, data_dir='./data', shuffle=False,
corruptions=[corruption_type])
# x_test, y_test = x_test.cuda(), y_test.cuda()
x_test_all.append(x_test)
y_test_all.append(y_test)
However, I got the error and set
num_workers=0
is useless.RuntimeError: DataLoader worker (pid(s) 29578) exited unexpectedly
Do you have any suggestions? Thanks in advance.