genforce / interfacegan

[CVPR 2020] Interpreting the Latent Space of GANs for Semantic Face Editing
https://genforce.github.io/interfacegan/
MIT License
1.51k stars 281 forks source link

RuntimeError: Given groups=1, weight of size [16, 16, 3, 3], expected input[4, 512, 1, 1] to have 16 channels, but got 512 channels instead #9

Closed c1a1o1 closed 5 years ago

c1a1o1 commented 5 years ago

E:\Users\Raytine\Anaconda3\python.exe F:/expression/InterFaceGAN-master/edit.py -m pggan_celebahq -b boundaries/pggan_celebahq_smile_boundary.npy -n 10 -o results/pggan_celebahq_smile_editing [2019-08-12 14:15:15,846][INFO] Initializing generator. [2019-08-12 14:15:15,972][INFO] Loading pytorch model from {self.model_path}. [2019-08-12 14:15:16,002][INFO] Successfully loaded! [2019-08-12 14:15:17,357][INFO] Preparing boundary. 0%| | 0/10 [00:00<?, ?it/s][2019-08-12 14:15:17,394][INFO] Preparing latent codes. [2019-08-12 14:15:17,394][INFO] Sample latent codes randomly. [2019-08-12 14:15:17,395][INFO] Editing {total_num} samples. Traceback (most recent call last): File "F:/expression/InterFaceGAN-master/edit.py", line 114, in main() File "F:/expression/InterFaceGAN-master/edit.py", line 100, in main outputs = model.easy_synthesize(interpolations_batch) File "F:\expression\InterFaceGAN-master\models\base_generator.py", line 230, in easy_synthesize outputs = self.synthesize(latent_codes, kwargs) File "F:\expression\InterFaceGAN-master\models\pggan_generator.py", line 132, in synthesize images = self.model(zs) File "E:\Users\Raytine\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call result = self.forward(*input, *kwargs) File "F:\expression\InterFaceGAN-master\models\pggan_generator_model.py", line 127, in forward return super().forward(x) File "E:\Users\Raytine\Anaconda3\lib\site-packages\torch\nn\modules\container.py", line 91, in forward input = module(input) File "E:\Users\Raytine\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call result = self.forward(input, kwargs) File "F:\expression\InterFaceGAN-master\models\pggan_generator_model.py", line 243, in forward x = self.conv(x) File "E:\Users\Raytine\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call result = self.forward(*input, **kwargs) File "E:\Users\Raytine\Anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 301, in forward self.padding, self.dilation, self.groups) RuntimeError: Given groups=1, weight of size [16, 16, 3, 3], expected input[4, 512, 1, 1] to have 16 channels, but got 512 channels instead

ShenYujun commented 5 years ago

I really don’t get your point. This repo works well for me.