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

Running errors #13

Open
Cqbelt opened this issue Dec 21, 2020 · 4 comments
Open

Running errors #13

Cqbelt opened this issue Dec 21, 2020 · 4 comments

Comments

@Cqbelt
Copy link

Cqbelt commented Dec 21, 2020

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

@yaoyao-liu
Copy link
Owner

Hi @Cqbelt,

Thanks for your interest in our work.
Could you please check whether you use the same version of torchvision as mine?

Best,
Yaoyao

@Cqbelt
Copy link
Author

Cqbelt commented Dec 29, 2020

Thanks a lot, I'll have a look.

@Liuhao-128
Copy link

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),

@yaoyao-liu
Copy link
Owner

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.

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

3 participants