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

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

Open
0width opened this issue Jun 26, 2023 · 9 comments
Open

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

0width opened this issue Jun 26, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@0width
Copy link

0width commented Jun 26, 2023

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

@alienhd
Copy link

alienhd commented Jun 26, 2023

Same for me.

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

@Zeqiang-Lai Zeqiang-Lai added the bug Something isn't working label Jun 26, 2023
@Zeqiang-Lai
Copy link
Collaborator

Zeqiang-Lai commented Jun 26, 2023

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

@tk-da
Copy link

tk-da commented Jun 26, 2023

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
Copy link

tk-da commented Jun 26, 2023

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

@Zeqiang-Lai
Copy link
Collaborator

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

@tk-da
Copy link

tk-da commented Jun 26, 2023

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

@Zeqiang-Lai
Copy link
Collaborator

See #39 (comment)

@tk-da
Copy link

tk-da commented Jun 26, 2023

Thanks!

@OnlySoaring
Copy link

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants