Running errors
Cqbelt opened this issue · 4 comments
Hi, Professors. there are bugs when I run the code. Can you explain what they mean and how to solve the problems?
Traceback (most recent call last):
File "main.py", line 78, in
trainer.train()
File "/home/gyc/class-incremental-learning/mnemonics-training/1_train/trainer/baseline.py", line 237, in train
tg_model = incremental_train_and_eval(self.args.epochs, tg_model, ref_model, free_model, ref_free_model, tg_optimizer, tg_lr_scheduler, trainloader, testloader, iteration, start_iter, cur_lamda, self.args.dist, self.args.K, self.args.lw_mr)
File "/home/gyc/class-incremental-learning/mnemonics-training/1_train/trainer/incremental.py", line 32, in incremental_train_and_eval
for batch_idx, (inputs, targets) in enumerate(trainloader):
File "/home/gyc/.conda/envs/tmp/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "/home/gyc/.conda/envs/tmp/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/home/gyc/.conda/envs/tmp/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 57, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/gyc/.conda/envs/tmp/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 57, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/gyc/.conda/envs/tmp/lib/python3.6/site-packages/torchvision/datasets/cifar.py", line 90, in getitem
img, target = self.train_data[index], self.train_labels[index]
IndexError: index 46523 is out of bounds for axis 0 with size 25000
Thanks a lot, I'll have a look.
Hi, Professors. there bugs when I run the code. Can you explain what they mean and how to solve the problem?
when running mnemonics-training . main , 'CIFAR100' object has no attribute 'train_data',
line 62, in train
X_train_total = np.array(self.trainset.train_data),
Hi @Liuhao-128,
Thanks for your interest in our work.
May I know the PyTorch version you are using? If you are not using the PyTorch version I mentioned in the README file, you may try to switch to that version.