wetliu / energy_ood

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hey, great job! I want to know what happened to this mistake during my training. Thank you!

lsqxxx opened this issue · comments

commented

{'batch_size': 128, 'calibration': False, 'dataset': 'cifar10', 'decay': 0.0005, 'droprate': 0.3, 'epochs': 10, 'layers': 40, 'learning_rate': 0.001, 'load': './snapshots/pretrained', 'm_in': -25.0, 'm_out': -7.0, 'model': 'wrn', 'momentum': 0.9, 'ngpu': 1, 'oe_batch_size': 256, 'prefetch': 4, 'save': './snapshots/oe_tune', 'score': 'OE', 'seed': 1, 'test': False, 'test_bs': 200, 'widen_factor': 2}
Files already downloaded and verified
Model restored! Epoch: 99
Beginning Training

Traceback (most recent call last):
File "/home/xxx/code/energy_ood-master/CIFAR/train.py", line 257, in
train()
File "/home/xxx/code/energy_ood-master/CIFAR/train.py", line 180, in train
for in_set, out_set in zip(train_loader_in, train_loader_out):
File "/home/xxx/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in next
data = self._next_data()
File "/home/xxx/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data
return self._process_data(data)
File "/home/xxx/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data
data.reraise()
File "/home/xxx/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/_utils.py", line 429, in reraise
raise self.exc_type(msg)
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/xxx/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "/home/xxx/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/xxx/anaconda3/envs/detectron2/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/xxx/code/energy_ood-master/utils/tinyimages_80mn_loader.py", line 51, in getitem
img = self.load_image(index)
File "/home/xxx/code/energy_ood-master/utils/tinyimages_80mn_loader.py", line 16, in load_image
return np.fromstring(data, dtype='uint8').reshape(32, 32, 3, order="F")
ValueError: cannot reshape array of size 0 into shape (32,32,3)

Process finished with exit code 1

It seems your tinyimages file has some problem. You might want to check if you download it correctly.

commented

The tinyimages dataset can't be downloaded. How can I use another dataset to train instead of it

There is a replacement for tinyimages available in the outlier exposure codebase. We recommend checking that out.