Open Deerzh opened 2 years ago
Thank you for you reply, I have run it successfully.
But now I have new question, because I just want to run it successfully and finish the train process as fast as possible, so I modify epoch=1 and total_step=500,then an orror occurred:
"See the documentation of nn.Upsample for details.".format(mode)
( step: 199, ) G_Loss: 7.392 G_ID: 0.942 G_Rec: 11.906 G_feat_match: 2.901 D_fake: 0.006 D_real: 0.144 D_loss: 0.150
( step: 399, ) G_Loss: 5.804 G_ID: 1.007 G_Rec: 10.470 G_feat_match: 2.805 D_fake: 0.033 D_real: 0.025 D_loss: 0.058
Traceback (most recent call last):
File "train.py", line 290, in
Can you help me fixed this issue?
I have solved this problem by the follwing steps: pip install wandb. And add import wandb in train.py
actually no need to install wandb. as the author doesn't use it at all. I just comment it
Use: pip3 install -U timm==0.5.4
when I run this command: python train.py --name simswap224_test --batchSize 8 --gpu_ids 1 --dataset vggface2 --Gdeep False an erroe occurred: /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.parallel.data_parallel.DataParallel' has changed. you can retrieve the original source code by accessing the object's source attribute or set
model.initialize(opt)
File "/home/zhang/compatibility_analysis/SimSwap/models/projected_model.py", line 57, in initialize
self.netD = ProjectedDiscriminator(diffaug=False, interp224=False, {})
File "/home/zhang/compatibility_analysis/SimSwap/pg_modules/projected_discriminator.py", line 161, in init
self.feature_network = F_RandomProj(backbone_kwargs)
File "/home/zhang/compatibility_analysis/SimSwap/pg_modules/projector.py", line 108, in init
self.pretrained, self.scratch = _make_projector(im_res=im_res, cout=self.cout, proj_type=self.proj_type, expand=self.expand)
File "/home/zhang/compatibility_analysis/SimSwap/pg_modules/projector.py", line 64, in _make_projector
pretrained = _make_efficientnet(model)
File "/home/zhang/compatibility_analysis/SimSwap/pg_modules/projector.py", line 35, in _make_efficientnet
pretrained.layer0 = nn.Sequential(model.conv_stem, model.bn1, model.act1, *model.blocks[0:2])
File "/home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/nn/modules/module.py", line 948, in getattr
type(self).name, name))
AttributeError: 'EfficientNet' object has no attribute 'act1'
torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.activation.PReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.AdaptiveAvgPool2d' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.activation.Sigmoid' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) /home/zhang/anaconda3/envs/Sim/lib/python3.7/site-packages/torch/serialization.py:656: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm1d' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = True
and use the patch tool to revert the changes. warnings.warn(msg, SourceChangeWarning) Traceback (most recent call last): File "train.py", line 139, inCan you help me solve this issue?