Heonozis / FaceShifter-pytorch

115 stars 27 forks source link

RuntimeError: Sizes of tensors must match except in dimension 2. Got 13 and 12 #12

Closed Yunlong-He closed 2 years ago

Yunlong-He commented 4 years ago

When I run "pytthon train_aei.py",I got following error, is there anyone knowing why? Thanks

Selected optimization level O1: Insert automatic casts around Pytorch functions and Tensor methods.

Defaults for this optimization level are: enabled : True opt_level : O1 cast_model_type : None patch_torch_functions : True keep_batchnorm_fp32 : None master_weights : None loss_scale : dynamic Processing user overrides (additional kwargs that are not None)... After processing overrides, optimization options are: enabled : True opt_level : O1 cast_model_type : None patch_torch_functions : True keep_batchnorm_fp32 : None master_weights : None loss_scale : dynamic Warning: multi_tensor_applier fused unscale kernel is unavailable, possibly because apex was installed without --cuda_ext --cpp_ext. Using Python fallback. Original ImportError was: ModuleNotFoundError("No module named 'amp_C'",) Selected optimization level O1: Insert automatic casts around Pytorch functions and Tensor methods.

Defaults for this optimization level are: enabled : True opt_level : O1 cast_model_type : None patch_torch_functions : True keep_batchnorm_fp32 : None master_weights : None loss_scale : dynamic Processing user overrides (additional kwargs that are not None)... After processing overrides, optimization options are: enabled : True opt_level : O1 cast_model_type : None patch_torch_functions : True keep_batchnorm_fp32 : None master_weights : None loss_scale : dynamic False

Traceback (most recent call last): File "train_aei.py", line 96, in Y, Xt_attr = G(Xt, embed) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, kwargs) File "/lab/github/face/FaceShifter-pytorch/network/aei.py", line 111, in forward attr = self.encoder(Xt) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, *kwargs) File "/lab/github/face/FaceShifter-pytorch/network/aei.py", line 65, in forward z_att2 = self.conv_t1(z_att1, enc4) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(input, kwargs) File "/lab/github/face/FaceShifter-pytorch/network/aei.py", line 37, in forward return torch.cat((x, skip), dim=1) File "/usr/local/lib/python3.6/dist-packages/apex-0.1-py3.6.egg/apex/amp/wrap.py", line 81, in wrapper return orig_fn(seq, *args, *kwargs) File "/usr/local/lib/python3.6/dist-packages/apex-0.1-py3.6.egg/apex/amp/wrap.py", line 81, in wrapper return orig_fn(seq, args, **kwargs) RuntimeError: Sizes of tensors must match except in dimension 2. Got 13 and 12 root@neufoundry-test-gpu-host14:/lab/github/face/FaceShifter-pytorch#

SajjadAemmi commented 3 years ago

run this command to rezise dataset images before training: python face_modules/preprocess_images.py