AliaksandrSiarohin / first-order-model

This repository contains the source code for the paper First Order Motion Model for Image Animation
https://aliaksandrsiarohin.github.io/first-order-model-website/
MIT License
14.57k stars 3.22k forks source link

load() missing 1 required positional argument: 'Loader' #512

Open makabaka1213 opened 2 years ago

makabaka1213 commented 2 years ago

Hi. I'm having some problems here.from demo import load_checkpoints generator, kp_detector = load_checkpoints(config_path='config/vox-256.yaml', checkpoint_path='/content/gdrive/My Drive/first-order-motion-model/vox-cpk.pth.tar') i'm noticing that the " checkpoint_path='/content/gdrive/My Drive/first-order-motion-model/vox-cpk.pth.tar')" ckage is red-underlined. I got an errorload() missing 1 required positional argument: 'Loader' Can someone tell me what should i do?

ghost commented 2 years ago

TypeError Traceback (most recent call last) in 1 from demo import load_checkpoints 2 generator, kp_detector = load_checkpoints(config_path='config/vox-256.yaml', ----> 3 checkpoint_path='/content/gdrive/My Drive/first-order-motion-model/vox-cpk.pth.tar')

/content/first-order-model/demo.py in load_checkpoints(config_path, checkpoint_path, cpu) 25 26 with open(config_path) as f: ---> 27 config = yaml.load(f) 28 29 generator = OcclusionAwareGenerator(**config['model_params']['generator_params'],

TypeError: load() missing 1 required positional argument: 'Loader'

JoePilliner commented 2 years ago

https://stackoverflow.com/questions/69564817/typeerror-load-missing-1-required-positional-argument-loader-in-google-col

!pip install pyyaml==5.4.1

It doesn't fix the other problems with the demo but at least I can generate SOMETHING

makabaka1213 commented 2 years ago

https://stackoverflow.com/questions/69564817/typeerror-load-missing-1-required-positional-argument-loader-in-google-col

!pip install pyyaml==5.4.1

它没有解决演示的其他问题,但至少我可以生成一些东西

Thank you very much

aycaecemgul commented 2 years ago

I got the same error and installing pyyaml==5.4.1 did work on old demo only.

Terry-mine commented 8 months ago

改为full_load()

Ahmed-Ezzat20 commented 4 months ago

I have tried both ways and it doesn't work for me in colab

TypeError Traceback (most recent call last) in <cell line: 3>() 1 from demo import load_checkpoints 2 ----> 3 generator, region_predictor, avd_network = load_checkpoints(config_path='/content/articulated-animation/config/ted384.yaml', 4 checkpoint_path='/content/articulated-animation/ted384.pth')

/content/articulated-animation/demo.py in load_checkpoints(config_path, checkpoint_path, cpu) 34 def load_checkpoints(config_path, checkpoint_path, cpu=False): 35 with open(config_path) as f: ---> 36 config = yaml.load(f) 37 38 generator = Generator(num_regions=config['model_params']['num_regions'],

TypeError: load() missing 1 required positional argument: 'Loader'

@Terry-mine

Terry-mine commented 4 months ago

I have tried both ways and it doesn't work for me in colab

TypeError Traceback (most recent call last) in <cell line: 3>() 1 from demo import load_checkpoints 2 ----> 3 generator, region_predictor, avd_network = load_checkpoints(config_path='/content/articulated-animation/config/ted384.yaml', 4 checkpoint_path='/content/articulated-animation/ted384.pth')

/content/articulated-animation/demo.py in load_checkpoints(config_path, checkpoint_path, cpu) 34 def load_checkpoints(config_path, checkpoint_path, cpu=False): 35 with open(config_path) as f: ---> 36 config = yaml.load(f) 37 38 generator = Generator(num_regions=config['model_params']['num_regions'],

TypeError: load() missing 1 required positional argument: 'Loader'

@Terry-mine

I have tried it on my own computer.it works,Maybe I think you should try update the yaml package and change the line 36 into "config = yaml.full_load(f)".or you can learn the yaml package from stack overflow.