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

I met another question during the training #5

Open
lisaner000 opened this issue Apr 9, 2024 · 4 comments
Open

I met another question during the training #5

lisaner000 opened this issue Apr 9, 2024 · 4 comments

Comments

@lisaner000
Copy link

Traceback (most recent call last):
File "train.py", line 168, in
main(cfg)
File "train.py", line 159, in main
debug_freq=cfg.DEBUG_FREQ,
File "/root/autodl-tmp/STAF-main/lib/core/trainer.py", line 400, in fit
self.train() # 调用 train 方法进行模型训练
File "/root/autodl-tmp/STAF-main/lib/core/trainer.py", line 227, in train
scores=scores,
File "/root/miniconda3/envs/yzy_staf/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/root/autodl-tmp/STAF-main/lib/core/loss.py", line 116, in forward
pred_theta = pred_theta[w_smpl]
IndexError: The shape of the mask [39] at index 0 does not match the shape of the indexed tensor [0, 85] at index 0
Can you give me some advice?

@yw0208
Copy link
Owner

yw0208 commented Apr 9, 2024

It seems like there are some mistakes in data loading. Because it's wired, the shape of pred_theta is [0, 85]. You should debug to check what went wrong.

@lisaner000
Copy link
Author

It seems like there are some mistakes in data loading. Because it's wired, the shape of pred_theta is [0, 85]. You should debug to check what went wrong.

It achieves the training successfully. Thank you very much!

@lisaner000
Copy link
Author

Another, I met a bug during the evaluting as the following:
Traceback (most recent call last):
File "evaluate.py", line 94, in
model.load_state_dict(checkpoint['gen_state_dict'])
File "/root/miniconda3/envs/yzy_staf/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1498, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for SAFM:
Missing key(s) in state_dict: "nonlocalblock.attention.fc.weight", "nonlocalblock.attention.fc.bias", "nonlocalblock.attention.attention.0.weight", "nonlocalblock.attention.attention.0.bias", "nonlocalblock.attention.attention.2.weight", "nonlocalblock.attention.attention.2.bias", "nonlocalblock.attention.attention.4.weight", "nonlocalblock.attention.attention.4.bias".
Unexpected key(s) in state_dict: "points_grid", "deconv_layers.0.weight", "deconv_layers.1.weight", "deconv_layers.1.bias", "deconv_layers.1.running_mean", "deconv_layers.1.running_var", "deconv_layers.1.num_batches_tracked", "deconv_layers.3.weight", "deconv_layers.4.weight", "deconv_layers.4.bias", "deconv_layers.4.running_mean", "deconv_layers.4.running_var", "deconv_layers.4.num_batches_tracked", "deconv_layers.6.weight", "deconv_layers.7.weight", "deconv_layers.7.bias", "deconv_layers.7.running_mean", "deconv_layers.7.running_var", "deconv_layers.7.num_batches_tracked", "maf_extractor.0.Dmap", "maf_extractor.0.conv0.weight", "maf_extractor.0.conv0.bias", "maf_extractor.0.conv1.weight", "maf_extractor.0.conv1.bias", "maf_extractor.0.conv2.weight", "maf_extractor.0.conv2.bias", "maf_extractor.1.Dmap", "maf_extractor.1.conv0.weight", "maf_extractor.1.conv0.bias", "maf_extractor.1.conv1.weight", "maf_extractor.1.conv1.bias", "maf_extractor.1.conv2.weight", "maf_extractor.1.conv2.bias", "maf_extractor.2.Dmap", "maf_extractor.2.conv0.weight", "maf_extractor.2.conv0.bias", "maf_extractor.2.conv1.weight", "maf_extractor.2.conv1.bias", "maf_extractor.2.conv2.weight", "maf_extractor.2.conv2.bias", "regressor.0.init_pose", "regressor.0.init_shape", "regressor.0.init_cam", "regressor.0.fc1.weight", "regressor.0.fc1.bias", "regressor.0.fc2.weight", "regressor.0.fc2.bias", "regressor.0.decpose.weight", "regressor.0.decpose.bias", "regressor.0.decshape.weight", "regressor.0.decshape.bias", "regressor.0.deccam.weight", "regressor.0.deccam.bias", "regressor.0.smpl.betas", "regressor.0.smpl.global_orient", "regressor.0.smpl.body_pose", "regressor.0.smpl.faces_tensor", "regressor.0.smpl.v_template", "regressor.0.smpl.shapedirs", "regressor.0.smpl.J_regressor", "regressor.0.smpl.posedirs", "regressor.0.smpl.parents", "regressor.0.smpl.lbs_weights", "regressor.0.smpl.J_regressor_extra", "regressor.0.smpl.vertex_joint_selector.extra_joints_idxs", "regressor.1.init_pose", "regressor.1.init_shape", "regressor.1.init_cam", "regressor.1.fc1.weight", "regressor.1.fc1.bias", "regressor.1.fc2.weight", "regressor.1.fc2.bias", "regressor.1.decpose.weight", "regressor.1.decpose.bias", "regressor.1.decshape.weight", "regressor.1.decshape.bias", "regressor.1.deccam.weight", "regressor.1.deccam.bias", "regressor.1.smpl.betas", "regressor.1.smpl.global_orient", "regressor.1.smpl.body_pose", "regressor.1.smpl.faces_tensor", "regressor.1.smpl.v_template", "regressor.1.smpl.shapedirs", "regressor.1.smpl.J_regressor", "regressor.1.smpl.posedirs", "regressor.1.smpl.parents", "regressor.1.smpl.lbs_weights", "regressor.1.smpl.J_regressor_extra", "regressor.1.smpl.vertex_joint_selector.extra_joints_idxs", "regressor.2.init_pose", "regressor.2.init_shape", "regressor.2.init_cam", "regressor.2.fc1.weight", "regressor.2.fc1.bias", "regressor.2.fc2.weight", "regressor.2.fc2.bias", "regressor.2.decpose.weight", "regressor.2.decpose.bias", "regressor.2.decshape.weight", "regressor.2.decshape.bias", "regressor.2.deccam.weight", "regressor.2.deccam.bias", "regressor.2.smpl.betas", "regressor.2.smpl.global_orient", "regressor.2.smpl.body_pose", "regressor.2.smpl.faces_tensor", "regressor.2.smpl.v_template", "regressor.2.smpl.shapedirs", "regressor.2.smpl.J_regressor", "regressor.2.smpl.posedirs", "regressor.2.smpl.parents", "regressor.2.smpl.lbs_weights", "regressor.2.smpl.J_regressor_extra", "regressor.2.smpl.vertex_joint_selector.extra_joints_idxs", "safm.nonlocalblock.attention.fc.weight", "safm.nonlocalblock.attention.fc.bias", "safm.nonlocalblock.attention.attention.0.weight", "safm.nonlocalblock.attention.attention.0.bias", "safm.nonlocalblock.attention.attention.2.weight", "safm.nonlocalblock.attention.attention.2.bias", "safm.nonlocalblock.attention.attention.4.weight", "safm.nonlocalblock.attention.attention.4.bias", "tcfm.nonlocalblock.conv_phi.weight", "tcfm.nonlocalblock.conv_theta.weight", "tcfm.nonlocalblock.conv_g.weight", "tcfm.nonlocalblock.conv_mask.weight", "tcfm.nonlocalblock.conv_mask_forR.weight".

@yw0208
Copy link
Owner

yw0208 commented Apr 11, 2024

refer to issue

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