harlanhong / CVPR2022-DaGAN

Official code for CVPR2022 paper: Depth-Aware Generative Adversarial Network for Talking Head Video Generation
https://harlanhong.github.io/publications/dagan.html
Other
957 stars 125 forks source link

Installed according to the instructions but Im getting this: TypeError: load() missing 1 required positional argument: 'Loader' #69

Closed chille9 closed 7 months ago

chille9 commented 1 year ago

pytorch version 2.0 python 3.10 PyYAML v-6.0

C:\AI\CVPR2022-DaGAN>python demo.py --config config/vox-adv-256.yaml --driving_video video/brol.mp4 --source_image input/dam3.jpg --checkpoint checkpoint/SPADE_DaGAN_vox_adv_256.pth.tar --relative --adapt_scale --kp_num 15 --generator SPADEDepthAwareGenerator C:\Users\dustg\AppData\Local\Programs\Python\Python310\lib\site-packages\torchvision\models_utils.py:135: UserWarning: Using 'weights' as positional parameter(s) is deprecated since 0.13 and may be removed in the future. Please use keyword parameter(s) instead. warnings.warn( C:\Users\dustg\AppData\Local\Programs\Python\Python310\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=None. warnings.warn(msg) C:\AI\CVPR2022-DaGAN\demo.py:176: DeprecationWarning: Starting with ImageIO v3 the behavior of this function will switch to that of iio.v3.imread. To keep the current behavior (and make this warning disappear) use import imageio.v2 as imageio or call imageio.v2.imread directly. source_image = imageio.imread(opt.source_image) Traceback (most recent call last): File "C:\AI\CVPR2022-DaGAN\demo.py", line 189, in generator, kp_detector = load_checkpoints(config_path=opt.config, checkpoint_path=opt.checkpoint, cpu=opt.cpu) File "C:\AI\CVPR2022-DaGAN\demo.py", line 27, in load_checkpoints config = yaml.load(f) TypeError: load() missing 1 required positional argument: 'Loader'

is this something related to the yaml file?

harlanhong commented 1 year ago

That is caused by your yaml version, you can change to : config = yaml.load(f, Loader=yaml.FullLoader)

chille9 commented 1 year ago

Thank you. For others wondering you can find the config line in the demo.py file!