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

the problem of train #103

Closed
zhaojc001 opened this issue Oct 26, 2020 · 3 comments
Closed

the problem of train #103

zhaojc001 opened this issue Oct 26, 2020 · 3 comments

Comments

@zhaojc001
Copy link

when I run the following command,it appears the following problem.please help me:
python2 train_hopenet.py --dataset Pose_300W_LP --data_dir /opt/my/head_pose_estimate/300W_LP --filename_list /opt/my/head_pose_estimate/300W_LP/train.txt

Loading data.
/usr/local/lib/python2.7/dist-packages/torchvision/transforms/transforms.py:211: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
"please use transforms.Resize instead.")
Ready to train network.
train_hopenet.py:172: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
yaw_predicted = softmax(yaw)
train_hopenet.py:173: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
pitch_predicted = softmax(pitch)
train_hopenet.py:174: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
roll_predicted = softmax(roll)
/pytorch/aten/src/THCUNN/ClassNLLCriterion.cu:105: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [10,0,0] Assertion t >= 0 && t < n_classes failed.
Traceback (most recent call last):
File "train_hopenet.py", line 180, in
loss_reg_yaw = reg_criterion(yaw_predicted, label_yaw_cont)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/loss.py", line 431, in forward
return F.mse_loss(input, target, reduction=self.reduction)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py", line 2190, in mse_loss
ret = torch._C._nn.mse_loss(expanded_input, expanded_target, _Reduction.get_enum(reduction))
RuntimeError: reduce failed to synchronize: device-side assert triggered

@iiTzFrankie
Copy link

#6
I think this will be helpful

@zhaojc001
Copy link
Author

Now,I train the model using the following command,it occurs the error:
python2 train_hopenet.py --dataset Pose_300W_LP --data_dir 300W_LP --filename_list /opt/my/head_pose_estimate/deep-head-pose/code/300W_LP/300W_LP_filename_filtered.txt
Loading data.
/usr/local/lib/python2.7/dist-packages/torchvision/transforms/transforms.py:211: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
"please use transforms.Resize instead.")
Ready to train network.
train_hopenet.py:172: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
yaw_predicted = softmax(yaw)
train_hopenet.py:173: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
pitch_predicted = softmax(pitch)
train_hopenet.py:174: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
roll_predicted = softmax(roll)
Traceback (most recent call last):
File "train_hopenet.py", line 197, in
%(epoch+1, num_epochs, i+1, len(pose_dataset)//batch_size, loss_yaw.data[0], loss_pitch.data[0], loss_roll.data[0]))
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

@zxcvbnm12316
Copy link

@zhaojc001
hello,I display this code when I run the ‘’train_hopenet.py‘’ code“torch.autograd.backward(loss_seq, grad_seq)”,An error occurred,RuntimeError: Mismatch in shape: grad_output[0] has a shape of torch.Size([1]) and output[0] has a shape of torch.Size([]). I don't know how to change, please help, thank you

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