Pretrained network G has fewer layers; The following are not initialized: ['down0', 'first_layer', 'last_layer', 'up0'] #485

Open
opened 2025-04-20 14:19:44 +02:00 by Adreame7 · 2 comments
Adreame7 commented 2025-04-20 14:19:44 +02:00 (Migrated from github.com)

when i run test_one_image.py exits this issue: Pretrained network G has fewer layers; The following are not initialized: ['down0', 'first_layer', 'last_layer', 'up0']

when i run test_one_image.py exits this issue: Pretrained network G has fewer layers; The following are not initialized: ['down0', 'first_layer', 'last_layer', 'up0']
KahnSvaer commented 2025-05-07 21:41:44 +02:00 (Migrated from github.com)

Same issue with another one on collab file

Pretrained network G has fewer layers; The following are not initialized:
['down0', 'first_layer', 'last_layer', 'up0']

AssertionError Traceback (most recent call last)
in <cell line: 0>()
17 model.eval()
18
---> 19 app = Face_detect_crop(name='antelope', root='./insightface_func/models')
20 app.prepare(ctx_id= 0, det_thresh=0.6, det_size=(640,640))
21

/content/SimSwap/insightface_func/face_detect_crop_multi.py in init(self, name, root)
45 print('duplicated model task type, ignore:', onnx_file, model.taskname)
46 del model
---> 47 assert 'detection' in self.models
48 self.det_model = self.models['detection']
49

AssertionError:

Same issue with another one on collab file Pretrained network G has fewer layers; The following are not initialized: ['down0', 'first_layer', 'last_layer', 'up0'] --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) [<ipython-input-6-46a887c84c9b>](https://localhost:8080/#) in <cell line: 0>() 17 model.eval() 18 ---> 19 app = Face_detect_crop(name='antelope', root='./insightface_func/models') 20 app.prepare(ctx_id= 0, det_thresh=0.6, det_size=(640,640)) 21 [/content/SimSwap/insightface_func/face_detect_crop_multi.py](https://localhost:8080/#) in __init__(self, name, root) 45 print('duplicated model task type, ignore:', onnx_file, model.taskname) 46 del model ---> 47 assert 'detection' in self.models 48 self.det_model = self.models['detection'] 49 AssertionError:
KahnSvaer commented 2025-05-08 12:39:06 +02:00 (Migrated from github.com)

Though this seems to be working

you need to set crop_size to 224, run: !python test_one_image.py --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path crop_224/6.jpg --pic_b_path crop_224/ds.jpg --output_path output/ --crop_size 224

Originally posted by @luoxyhappy in #483

But the results were not that great not sure if I did some mistake

Though this seems to be working > you need to set crop_size to 224, run: !python test_one_image.py --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path crop_224/6.jpg --pic_b_path crop_224/ds.jpg --output_path output/ --crop_size 224 _Originally posted by @luoxyhappy in [#483](https://github.com/neuralchen/SimSwap/issues/483#issuecomment-2720679511)_ But the results were not that great not sure if I did some mistake
Sign in to join this conversation.