vt-vl-lab / 3d-photo-inpainting

[CVPR 2020] 3D Photography using Context-aware Layered Depth Inpainting
https://shihmengli.github.io/3D-Photo-Inpainting/
Other
6.88k stars 1.11k forks source link

python main.py --config argument.yml #170

Open wlwlwlw2010 opened 1 year ago

wlwlwlw2010 commented 1 year ago

Hi, how can I solve this problem:

python main.py --config argument.yml Traceback (most recent call last): File "main.py", line 29, in config = yaml.load(open(args.config, 'r')) TypeError: load() missing 1 required positional argument: 'Loader'

tobihofer commented 1 year ago

found a solution here: https://bobbyhadz.com/blog/python-typeerror-load-missing-1-required-positional-argument-loader

You have to edit "main.py" and change line 29 from "config = yaml.load(open(args.config, 'r'))" to "config = yaml.full_load(open(args.config, 'r'))"

_The Python "TypeError: load() missing 1 required positional argument: 'Loader'" occurs when we use the yaml.load() method without specifying the Loader keyword argument. To solve the error, use the yaml.fullload() method instead or explicitly set the Loader keyword arg.

AhabbscienceStudioPak commented 1 year ago

found a solution here: https://bobbyhadz.com/blog/python-typeerror-load-missing-1-required-positional-argument-loader

You have to edit "main.py" and change line 29 from "config = yaml.load(open(args.config, 'r'))" to "config = yaml.full_load(open(args.config, 'r'))"

_The Python "TypeError: load() missing 1 required positional argument: 'Loader'" occurs when we use the yaml.load() method without specifying the Loader keyword argument. To solve the error, use the yaml.fullload() method instead or explicitly set the Loader keyword arg.

Thanks a lot. You're a lifesaver.

Bombelkie commented 1 year ago

I chang it to "config = yaml.full_load(open(args.config, 'r'))" it worked once and now it won't work anymore. It just says: running on device 0 0it [00:00, ?it/s]

Please help.

cmelian commented 1 year ago

It might be related to the input image format. The default is jpg. If you use png then you need to modify the argument.yml img_format: '.png'

Bombelkie commented 1 year ago

It might be related to the input image format. The default is jpg. If you use png then you need to modify the argument.yml img_format: '.png'

Thank you that worked😀

MatPrayer commented 1 year ago

Hi, I'm still having this issue even though I've changed line 29 from config = yaml.load(open(args.config, 'r')) to config = yaml.full_load(open(args.config, 'r')). I'm using .png images with img_format: '.png' and it doesn't work even if i change it back to .jpg .