Traceback (most recent call last):
File "C:\Users\spn\Fake\SimSwap\train.py", line 139, in
model.initialize(opt)
File "C:\Users\spn\Fake\SimSwap\models\projected_model.py", line 57, in initialize
self.netD = ProjectedDiscriminator(diffaug=False, interp224=False, **{})
File "C:\Users\spn\Fake\SimSwap\pg_modules\projected_discriminator.py", line 161, in init
self.feature_network = F_RandomProj(**backbone_kwargs)
File "C:\Users\spn\Fake\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 "C:\Users\spn\Fake\SimSwap\pg_modules\projector.py", line 64, in _make_projector
pretrained = _make_efficientnet(model)
File "C:\Users\spn\Fake\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 "L:\spn\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1207, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'EfficientNet' object has no attribute 'act1'
<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>
#solved by LAFLAMIE1024 >>>>>>>>>>
#I replaced the
model.act1
#by
nn.SiLU(inplace=False)
#after checking the meaning of act1. It works fine while training, and the validation result seems to be fine. However, I think I met the problem you mentioned : when I was trying to load my trained 512 simswap to do some infer, I was told that :
#Pretrained network G has fewer layers; The following are not initialized: ['down0', 'first_layer', 'last_layer', 'up0']
#So now I am trying to infer with the training code provided by @neuralchen