deepfakes / faceswap-playground

User dedicated repo for the faceswap project
306 stars 194 forks source link

_tkinter.TclError: couldn't recognize data in image file "..../faceswap/lib/gui/.cache/icons/open_folder.png" #237

Closed zoeleesss closed 5 years ago

zoeleesss commented 5 years ago

Expected behavior

I wanted to open gui, but can't.
I checked the permissions of the image file or the folder. And even make its permission to 777 , but still doesn't work.

image image

Actual behavior

image

Other relevant information

torzdf commented 5 years ago

Can you enter your faceswap environment and post the output of this command please: python -c "import tkinter ; print(tkinter.TkVersion, tkinter.TclVersion)"

zoeleesss commented 5 years ago

Can you enter your faceswap environment and post the output of this command please: python -c "import tkinter ; print(tkinter.TkVersion, tkinter.TclVersion)"

image @torzdf 8.5 8.5

torzdf commented 5 years ago

Ok. I'm not sure why this is then. I'm on version 8.6, but that shouldn't make a difference. These looks like a TCL issue rather than a Faceswap issue. Perhaps the image is corrupted? Maybe try to redownload the repo and see if it happens again?

zoeleesss commented 5 years ago

@torzdf So i just downloaded the file, and tried to replace the image file with it. But still doesnt work with same error. So.. am i supposed to upgrade the model tkinter or what? Any idea?

fzred commented 5 years ago

i'm same

➜  faceswap git:(master) ✗ python faceswap.py gui
01/25/2019 23:55:24 INFO     Log level set to: INFO
01/25/2019 23:55:26 ERROR    Got Exception on main handler:
Traceback (most recent call last):
  File "/Users/lred/projects/faceswap/lib/cli.py", line 89, in execute_script
    process = script(arguments)
  File "/Users/lred/projects/faceswap/scripts/gui.py", line 136, in __init__
    self.root = FaceswapGui(pathscript)
  File "/Users/lred/projects/faceswap/scripts/gui.py", line 27, in __init__
    self.images = Images(pathcache)
  File "/Users/lred/projects/faceswap/lib/gui/utils.py", line 29, in __call__
    **kwargs)
  File "/Users/lred/projects/faceswap/lib/gui/utils.py", line 182, in __init__
    "open_folder.png"))
  File "/Users/lred/.pyenv/versions/3.6.8/lib/python3.6/tkinter/__init__.py", line 3545, in __init__
    Image.__init__(self, 'photo', name, cnf, master, **kw)
  File "/Users/lred/.pyenv/versions/3.6.8/lib/python3.6/tkinter/__init__.py", line 3501, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize data in image file "/Users/lred/projects/faceswap/lib/gui/.cache/icons/open_folder.png"
01/25/2019 23:55:26 CRITICAL An unexpected crash has occurred. Crash report written to /Users/lred/projects/faceswap/crash_report.2019.01.25.235525903907.log. Please verify you are running the latest version of faceswap before reporting
torzdf commented 5 years ago

I need the actual generated crash reports for these: CRITICAL An unexpected crash has occurred. Crash report written to /Users/lred/projects/faceswap/crash_report.2019.01.25.235525903907.log. Please verify you are running the latest version of faceswap before reporting

fzred commented 5 years ago

Because tkinter version < 8.6 not support 'png'. So, i covert image png to gif, lib/gui/utils.py file change '.png' to '.gif. It's run. image

torzdf commented 5 years ago

It would be better to upgrade to tkinter version 8.6 if you can. There's no guarantee that this code won't change. I've made a note to change this to PIL for loading images though, which should fix all issues.

torzdf commented 5 years ago

This has been fixed in latest commit.