PaddlePaddle / PaddleGAN

PaddlePaddle GAN library, including lots of interesting applications like First-Order motion transfer, Wav2Lip, picture repair, image editing, photo2cartoon, image style transfer, GPEN, and so on.
Apache License 2.0
7.87k stars 1.25k forks source link

Code #337

Closed yyuu-6 closed 7 months ago

yyuu-6 commented 3 years ago

how to solve 'NoneType' object has no attribute 'read'

LielinJiang commented 3 years ago

能贴一下具体的代码不

yyuu-6 commented 3 years ago

pixel2style2pixel 代码里 能实现encoder吗?可以得到具体的特征向量吗?

yyuu-6 commented 3 years ago

pixel2style2pixel 代码里 能实现encoder吗?可以得到具体的特征向量吗?

yyuu-6 commented 3 years ago

执行Pixel2style2pixel.py时出现的'NoneType' object has no attribute 'read' Traceback (most recent call last): File "E:/study/GAN/Code/PaddleGAN-develop/PaddleGAN-develop/applications/tools/pixel2style2pixel.py", line 72, in predictor.run(args.input_image) File "E:\study\GAN\Code\PaddleGAN-develop\PaddleGAN-develop\ppgan\apps\pixel2style2pixel_predictor.py", line 188, in run src_img = run_alignment(image) File "E:\study\GAN\Code\PaddleGAN-develop\PaddleGAN-develop\ppgan\apps\pixel2style2pixel_predictor.py", line 65, in run_alignment img = Image.open(image_path).convert("RGB") File "E:\anaconda\setup\envs\pytorch\lib\site-packages\PIL\Image.py", line 2918, in open fp = io.BytesIO(fp.read()) AttributeError: 'NoneType' object has no attribute 'read'

LielinJiang commented 3 years ago

这个像是图片路径不对。可以看下windows的路径输入是反斜杠的。

python -u tools/pixel2style2pixel.py --input_image ../docs/imgs/pSp-input.jpg --model_type ffhq-toonify

我用这个命令在ubuntu系统是可以正常跑的

JunnYu commented 7 months ago

问题过于久远,如果有图像和视频生成的需求,可以使用新的跨模态工具: https://github.com/PaddlePaddle/PaddleMIX/tree/develop