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

Attribute Error: image #38

Open
alimehdi242 opened this issue Jun 25, 2023 · 4 comments
Open

Attribute Error: image #38

alimehdi242 opened this issue Jun 25, 2023 · 4 comments

Comments

@alimehdi242
Copy link

Traceback (most recent call last):
File "C:\Users\alime\Downloads\DragGAN-main1\DragGAN-main\dnnlib\util.py", line 45, in getattr
return self[name]
KeyError: 'image'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\alime\Downloads\DragGAN-main1\DragGAN-main\visualizer_drag.py", line 402, in
main()
File "C:\Users\alime\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Users\alime\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\alime\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\alime\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\Users\alime\Downloads\DragGAN-main1\DragGAN-main\visualizer_drag.py", line 396, in main
viz.draw_frame()
File "C:\Users\alime\Downloads\DragGAN-main1\DragGAN-main\visualizer_drag.py", line 181, in draw_frame
h, w, _ = self.result.image.shape
File "C:\Users\alime\Downloads\DragGAN-main1\DragGAN-main\dnnlib\util.py", line 47, in getattr
raise AttributeError(name)
AttributeError: image

@alimehdi242
Copy link
Author

I am using windows 11

@Aquahugs
Copy link

I am also running into this error. App loads but everything else crashes and throws this error once you try to add an image or load any of the models from recent.

@PDillis
Copy link
Contributor

PDillis commented Jun 26, 2023

Honestly, I found that removing that part of the code made it work. I'm guessing there's something missing/bug in the code, but in the meantime, removing these 3 lines lets you at least run the GUI locally (you won't be able to use the mask though):

These are lines 180-182 of visualizer_drag.py, so comment them out or something:

# if self.check_update_mask(**self.args):
#             h, w, _ = self.result.image.shape
#             self.drag_widget.init_mask(w, h)

@PDillis
Copy link
Contributor

PDillis commented Jun 27, 2023

Update: the PR ccd84ff has fixed this, so just do a git pull and the error shouldn't exist.

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