-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Failed to Load Image #174
Comments
It seems that libpng or graphicsmagick (native or lua wrapper) failed to load a PNG image. |
Thanks for your response. I couldnt resolve it. graphicsmagick and libpng are functional and I am using them. I might revisit this in future. Any plans for using torch image package or graphicsmagick directly instead of file io ? |
Try remove this pcall. Line 116 in 81a4de1
What a error is occurring? waifu2x is strongly dependent on graphicsmagick package(I sent a lot of PR to graphicsmagick), and RPC server requires a function that decoding the image from the blob. so I have no plans to change that code. |
I fixed io.read option(*a ->*all) |
Now I reinstalled Torch with lua5.2.
That error is caused by FFI type mismatch in graphicsmagick. |
Fixed some issues on lua 5.2 eb3926b . waifu2x.lua, convert_data.lua, train.lua works on lua 5.2 but web.lua does not work on lua 5.2 because turbo only supports luajit 2. |
Nice. @nagadomi thank you. I will try it soon. |
PR has merged. After updating graphicsmagick, it probably works.
|
Thank you
…On Thu, Mar 2, 2017 at 6:34 PM, nagadomi ***@***.***> wrote:
PR has merged. After updating graphicsmagick, it probably works.
luarocks install graphicsmagick
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#174 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADR7VT6B4tbiuSBYNwEIBjnRMBrP5ejhks5rh1IigaJpZM4MKnq6>
.
--
Kind regards
Sagar M Waghmare
|
I think I meet the same question ,could you help me ? |
I also still run into this problem. Often times it helps to just run
But even that doesn't work sometimes. It's especially weird as it seems to be deterministic which files don't work (running a script multiple times will always see the same files fail) even though in my case all the files were generated by another program in exactly the same way! The first image gives:
While the second upscales just fine (both running with just '-noise_level 3 -tta 1'). |
Both images worked in my environment. Perhaps it is the difference in graphicsmagick version or libpng version.
The difference between the two images is that the first image has ICC profile.
waifu2x uses GraphicsMagick, not ImageMagick. So you can try |
Is liblcms2(which is color management system library that is used for reading ICC profile) linked to graphicsmagick?
|
gm mogrify did not help, still seeing the exact same issue. I'm running macOS Sierra 10.12.6 btw |
It seems that lcms2 is disabled. Probably like this
|
Yes! Reinstalling with little-cms2 did the trick! Thank you so much! |
still having the problem... just reinstalled torch for cuda 10.0 using nagadomi instructions, installed all dependencies but still getting failed to load image error. I am on ubuntu 16.04 |
When reinstalling torch7, it will need to reinstall lua modules.
If you still get "failed to load image error", try #174 (comment) to see what kind of error you are actually getting in that exception. Line 114 in 5788a9f
-- local state, ret = pcall(load_image)
local ret = load_image()
local state = true |
Trying to run 'th waifu2x.lua'.
Following is the error log
All packages update to date. Using Lua5.2 instead of luajit.
Also tried with different images as well, same error.
waifu2x.lua:43: failed to load image: images/miku_small.png
stack traceback:
[C]: in function 'error'
waifu2x.lua:43: in function 'convert_image'
waifu2x.lua:291: in function 'waifu2x'
waifu2x.lua:296: in main chunk
[C]: in function 'dofile'
...mare/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: in ?
Kind regards
The text was updated successfully, but these errors were encountered: