DragGAN icon indicating copy to clipboard operation
DragGAN copied to clipboard

custom photo: NameError: name 'inverse_image' is not defined

Open 0width opened this issue 2 years ago • 9 comments

Traceback (most recent call last): File "C:\Users\xios.conda\envs\draggan\lib\site-packages\gradio\routes.py", line 406, in run_predict event_data=event_data, File "C:\Users\xios.conda\envs\draggan\lib\site-packages\gradio\blocks.py", line 1300, in process_api fn_index, inputs, iterator, request, event_id, event_data File "C:\Users\xios.conda\envs\draggan\lib\site-packages\gradio\blocks.py", line 1023, in call_function fn, *processed_input, limiter=self.limiter File "C:\Users\xios.conda\envs\draggan\lib\site-packages\anyio\to_thread.py", line 34, in run_sync func, *args, cancellable=cancellable, limiter=limiter File "C:\Users\xios.conda\envs\draggan\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "C:\Users\xios.conda\envs\draggan\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, *args) File "C:\Users\xios.conda\envs\draggan\lib\site-packages\draggan\web.py", line 183, in on_image_change result = inverse_image( NameError: name 'inverse_image' is not defined

0width avatar Jun 26 '23 08:06 0width

Same for me.

File "PathtoDragGAN\draggan\web.py", line 183, in on_image_change
    result = inverse_image(
NameError: name 'inverse_image' is not defined

alienhd avatar Jun 26 '23 09:06 alienhd

1.1.5 has a major update which makes old inverse_image incompatible. I am still working on the new one. If you want to try custom image now. Downgrade to 1.1.0

pip install draggan==1.1.0

Zeqiang-Lai avatar Jun 26 '23 10:06 Zeqiang-Lai

Doesn't work with 1.1.0 either: line 183, in on_image_change result = inverse_image( NameError: name 'inverse_image' is not defined

tk-da avatar Jun 26 '23 12:06 tk-da

Same with docker version, maybe this is missing: from .stylegan2.inversion import inverse_image ?

tk-da avatar Jun 26 '23 12:06 tk-da

Same with docker version, maybe this is missing: from .stylegan2.inversion import inverse_image ?

Are you sure you are running via the following commands ?

pip install draggan==1.1.0
python -m draggan.web

Zeqiang-Lai avatar Jun 26 '23 12:06 Zeqiang-Lai

Hm didn't restart my terminal, but now I get AttributeError: module 'torchvision.transforms' has no attribute 'Resize' when trying to load my image.

tk-da avatar Jun 26 '23 13:06 tk-da

See https://github.com/Zeqiang-Lai/DragGAN/issues/39#issuecomment-1594861501

Zeqiang-Lai avatar Jun 26 '23 13:06 Zeqiang-Lai

Thanks!

tk-da avatar Jun 26 '23 13:06 tk-da

Same with docker version, maybe this is missing: from .stylegan2.inversion import inverse_image ?

Are you sure you are running via the following commands ?

pip install draggan==1.1.0
python -m draggan.web

大佬,我draggan退回到1.1.0也还是报这个错唉,如果导入from draggan.deprecated.stylegan2.inversion import inverse_image的话,他会报 File "F:\DragGAN-main\gradio_app.py", line 184, in on_image_change model.g_ema, AttributeError: 'dict' object has no attribute 'g_ema'

OnlySoaring avatar Aug 16 '23 01:08 OnlySoaring