Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StyleGAN issue with dnnlib and tenflow version #810

Open
Vishwajeet-assert opened this issue Aug 21, 2023 · 1 comment
Open

StyleGAN issue with dnnlib and tenflow version #810

Vishwajeet-assert opened this issue Aug 21, 2023 · 1 comment
Assignees

Comments

@Vishwajeet-assert
Copy link

#I have paddle paddle cocker image version 2.3.2, cuda 11.8, python 3.8
#and the installed
python3 -m pip install --upgrade ppgan
#and downloaded the repo
git clone https://github.com/PaddlePaddle/PaddleGAN
#and then
cd PaddleGAN
#When I am trying to run StyleGAN V2 with
python -u tools/styleganv2.py --output_path /workspace/paddleGAN/output --weight_path /workspace/models/stylegan2-ffhq-config-f.pkl --model_type ffhq-config-f --seed 233 --size 1024 --style_dim 512 --n_mlp 8 --channel_multiplier 2 --n_row 3

#i am getting this error
File "tools/styleganv2.py", line 82, in
predictor = StyleGANv2Predictor(output_path=args.output_path,
File "/usr/local/lib/python3.8/dist-packages/ppgan/apps/styleganv2_predictor.py", line 130, in init
checkpoint = paddle.load(weight_path)
File "/usr/local/lib/python3.8/dist-packages/paddle/framework/io.py", line 954, in load
load_result = pickle.load(f, encoding='latin1')
ModuleNotFoundError: No module named 'dnnlib'

#when I have installed dnnlib with
pip install https://github.com/podgorskiy/dnnlib/releases/download/0.0.1/dnnlib-0.0.1-py3-none-any.whl

#facing this error of tensorflow version
Traceback (most recent call last):
File "tools/styleganv2.py", line 82, in
predictor = StyleGANv2Predictor(output_path=args.output_path,
File "/usr/local/lib/python3.8/dist-packages/ppgan/apps/styleganv2_predictor.py", line 130, in init
checkpoint = paddle.load(weight_path)
File "/usr/local/lib/python3.8/dist-packages/paddle/framework/io.py", line 954, in load
load_result = pickle.load(f, encoding='latin1')
File "/usr/local/lib/python3.8/dist-packages/dnnlib/tflib/init.py", line 8, in
from dnnlib.tflib import autosummary
File "/usr/local/lib/python3.8/dist-packages/dnnlib/tflib/autosummary.py", line 31, in
from dnnlib.tflib import tfutil
File "/usr/local/lib/python3.8/dist-packages/dnnlib/tflib/tfutil.py", line 34, in
def shape_to_list(shape: Iterable[tf.Dimension]) -> List[Union[int, None]]:
AttributeError: module 'tensorflow' has no attribute 'Dimension'

Kindly help with the solution ASAP

@JunnYu
Copy link
Member

JunnYu commented Feb 1, 2024

你好,发现你用的是 tensorflow存的stylegan权重,然后让paddle去加载?
当前支持转换后的paddle权重

'https://paddlegan.bj.bcebos.com/models/stylegan2-ffhq-config-f.pdparams',

'https://paddlegan.bj.bcebos.com/models/stylegan2-animeface-512.pdparams',

更多内容可以查看 https://aistudio.baidu.com/projectoverview/public?kw=styleganv2

另外,如果有图像和视频生成的需求,可以使用我们新的跨模态工具: https://github.com/PaddlePaddle/PaddleMIX/tree/develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants