Skip to content

Cannot process pkl files using legacy.load_network_pkl #33

@metaphorz

Description

@metaphorz

I am running a notebook called "structured dreaming". The notebook loads the pkl file using this:

print('Loading networks from "%s"...' % network_pkl) device = torch.device('cuda') with dnnlib.util.open_url(network_pkl) as f: G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore

For network_pkl, this works:

https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl'

but when I try one of your pkl files, for instance:

https://github.com/justinpinkney/awesome-pretrained-stylegan2#faces-FFHQ-config-f-512x512 (after downloading it first and then putting it into Gdrive), I get:

`Loading networks from "/content/drive/MyDrive/pretrained/ffhq-512-avg-tpurun1.pkl"...


ValueError Traceback (most recent call last)

in ()
5 device = torch.device('cuda')
6 with dnnlib.util.open_url(network_pkl) as f:
----> 7 G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
8 #
9 # Read the data from the file

1 frames

/content/stylegan2-ada-pytorch/legacy.py in convert_tf_generator(tf_G)
153 unknown_kwargs = list(set(tf_kwargs.keys()) - known_kwargs)
154 if len(unknown_kwargs) > 0:
--> 155 raise ValueError('Unknown TensorFlow kwarg', unknown_kwargs[0])
156
157 # Collect params.

ValueError: ('Unknown TensorFlow kwarg', 'resolution_h')

`

Do you have any suggestions? Your list of pretrained networks is great!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions