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

Got problems in training model #1

Open
lui1343 opened this issue Aug 8, 2023 · 1 comment
Open

Got problems in training model #1

lui1343 opened this issue Aug 8, 2023 · 1 comment

Comments

@lui1343
Copy link

lui1343 commented Aug 8, 2023

Thank you for your work and code!
When i try to train a model , i use the config you stored in ./configs. The config i set is like below:
python train.py --exp_path output --exp_config configs/celeba --exp_name celeba_rn18
But i meet some problems like:

File "train.py", line 49, in epoch_exp_stats
loss = F.cross_entropy(logits, labels, reduction='none')
File "/home/miniconda3/envs/cog/lib/python3.8/site-packages/torch/nn/functional.py", line 3026, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
TypeError: cross_entropy_loss(): argument 'input' (position 1) must be Tensor, not list

I didn't change the code, so i wonder if i set the config in a wrong way.
If you know why this happened , please offer me some help, Thanks a lot!

@HanxunH
Copy link
Owner

HanxunH commented Aug 8, 2023

Thanks for your interest in our work. For CelebA experiments, please use train_face_attr.py. All other arguments are the same.

I have just added this file: https://github.com/HanxunH/CognitiveDistillation/blob/main/train_face_attr.py

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

2 participants