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

TypeError: Image.__init__() got an unexpected keyword argument 'source' #124

Open
h21k opened this issue Mar 13, 2024 · 1 comment
Open

Comments

@h21k
Copy link

h21k commented Mar 13, 2024

Hi all got the following error on Colab:

File under cache_dir (./checkpoints):
['stylegan2_elephants_512_pytorch.pkl', 'stylegan2-afhqcat-512x512.pkl', 'stylegan2-cat-config-f.pkl', 'stylegan2_lions_512_pytorch.pkl', 'stylegan2_dogs_1024_pytorch.pkl', 'stylegan2_horses_256_pytorch.pkl', 'stylegan2-car-config-f.pkl', 'stylegan2-ffhq-512x512.pkl']
Valid checkpoint file:
{'stylegan2_elephants_512_pytorch': './checkpoints/stylegan2_elephants_512_pytorch.pkl', 'stylegan2-afhqcat-512x512': './checkpoints/stylegan2-afhqcat-512x512.pkl', 'stylegan2-cat-config-f': './checkpoints/stylegan2-cat-config-f.pkl', 'stylegan2_lions_512_pytorch': './checkpoints/stylegan2_lions_512_pytorch.pkl', 'stylegan2_dogs_1024_pytorch': './checkpoints/stylegan2_dogs_1024_pytorch.pkl', 'stylegan2_horses_256_pytorch': './checkpoints/stylegan2_horses_256_pytorch.pkl', 'stylegan2-car-config-f': './checkpoints/stylegan2-car-config-f.pkl', 'stylegan2-ffhq-512x512': './checkpoints/stylegan2-ffhq-512x512.pkl'}
Loading "./checkpoints/stylegan2_lions_512_pytorch.pkl"... Done.
()
{'z_dim': 512, 'c_dim': 0, 'w_dim': 512, 'img_resolution': 512, 'img_channels': 3, 'mapping_kwargs': {'num_layers': 8, 'embed_features': None, 'layer_features': None, 'activation': 'lrelu', 'lr_multiplier': 0.01, 'w_avg_beta': 0.995}, 'synthesis_kwargs': {'channel_base': 32768, 'channel_max': 512, 'num_fp16_res': 0, 'conv_clamp': None, 'architecture': 'skip', 'resample_filter': [1, 3, 3, 1], 'use_noise': True, 'activation': 'lrelu'}}
Setting up PyTorch plugin "bias_act_plugin"... Done.
Setting up PyTorch plugin "upfirdn2d_plugin"... Done.
Traceback (most recent call last):
File "/content/DragGAN/visualizer_drag_gradio.py", line 308, in
form_image = ImageMask(
File "/usr/local/lib/python3.10/dist-packages/gradio/component_meta.py", line 159, in wrapper
return fn(self, **kwargs)
File "/content/DragGAN/gradio_utils/utils.py", line 14, in init
super().init(source="upload",
File "/usr/local/lib/python3.10/dist-packages/gradio/component_meta.py", line 159, in wrapper
return fn(self, **kwargs)
TypeError: Image.init() got an unexpected keyword argument 'source'

@liuzz07
Copy link

liuzz07 commented Mar 15, 2024

gradio incompatible version issue, run pip install gradio==3.50.2 to fix

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

2 participants