OpenTalker / StyleHEAT

[ECCV 2022] StyleHEAT: A framework for high-resolution editable talking face generation
MIT License
627 stars 77 forks source link

can't run demo #22

Closed hello-eternity closed 1 year ago

hello-eternity commented 1 year ago

The error log is like this when running the python inference.py --config configs/inference.yaml --video_source=./docs/demo/videos/RD_Radio34_003_512.mp4 --image_source=./docs/demo/images/100.jpg --cross_id --output_dir=./docs/demo/output

Load pre-trained e4e Encoder from checkpoints/Encoder_e4e.pth done.
Load pre-trained hfgi encoder from checkpoints/hfgi.pth done.
Load pre-trained StyleGAN2 from checkpoints/StyleGAN_e4e.pth done.
Stage: inference
Load pre-trained StyleHEAT [net_G_ema] from checkpoints/StyleHEAT_visual.pt done
  0%|                                                                                             | 0/1 [00:07<?, ?it/s]
Traceback (most recent call last):
  File "inference.py", line 219, in <module>
    main()
  File "inference.py", line 202, in main
    data = dataset.load_next_video()
  File "/home/usr1/project/StyleHEAT/data/inference_dataset.py", line 174, in load_next_video
    video_data = self.data_preprocess(video_path, image_path)
  File "/home/usr1/project/StyleHEAT/data/inference_dataset.py", line 118, in data_preprocess
    source_3dmm = self.model_3dmm.get_3dmm([src_image_pil_256], lm_np)
AttributeError: 'NoneType' object has no attribute 'get_3dmm'
pegahs1993 commented 1 year ago

I have the same problem. I spent a lot of time trying to find a solution. But unfortunately I did not find anything. Please help me if anyone has solved this problem?

FeiiYin commented 1 year ago

Please add --if_extract for first inference.

pegahs1993 commented 1 year ago

Please add --if_extract for first inference.

By applying --if_extract this time I have two warnings that do not allow full execution. ــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode)) /usr/local/lib/python3.7/site-packages/torch/nn/functional.py:3385: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details. warnings.warn("Default grid_sample and affine_grid behavior has changed " ^C

SadafShafi commented 1 year ago

Please add --if_extract for first inference.

By applying --if_extract this time I have two warnings that do not allow full execution. ــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode)) /usr/local/lib/python3.7/site-packages/torch/nn/functional.py:3385: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details. warnings.warn("Default grid_sample and affine_grid behavior has changed " ^C

This happened because your RAM isn't enough, so it decided to terminate Either get more RAM or make your videos shorter, may be 2 seconds long and then test

I hope it works for you

FeiiYin commented 1 year ago

For RAM saving, you can save the intermediate frames into .jpg directly after generation instead of merging after the full video generation. Then you can merge the frames after the reenactment inferencing.

buaajky commented 1 year ago

Your post helped me a lot. Thx!!!