satoshiiizuka / siggraph2016_colorization

Code for the paper 'Let there be Color!: Joint End-to-end Learning of Global and Local Image Priors for Automatic Image Colorization with Simultaneous Classification'.
http://hi.cs.waseda.ac.jp/~iizuka/projects/colorization/
Other
2.16k stars 302 forks source link

t7 file open fails #8

Open fyngyrz opened 8 years ago

fyngyrz commented 8 years ago

Colornet file sha1sum and md5sum are both correct as detailed in issue 7. File size is correct. Problem persists where the load fails early in the script before anything else really happens. Member "franverona" is also seeing this error with a later Ubuntu, hopefully will post here as well.

franverona commented 8 years ago

Yes, that's correct. As I said in issue #7, I have 8Gb RAM and Ubuntu 16.04 TLS (xenial).

The exact line where error appears is in line 23 of colorize.lua file:

local d = torch.load( 'colornet.t7' )
bobbens commented 8 years ago

Discarding model corruption and lack of RAM, the only thing I can think of is incompatibility between the torch version you guys are using and the torch version the model is saved in. You have done an install following the instructions on http://torch.ch/docs/getting-started.html recently right?

franverona commented 8 years ago

Yes, I installed it yesterday following those instructions.

The trace (if helpful) is this:

franverona@fran-ubuntu:~/Downloads/siggraph2016_colorization-master$ th ansel_colorado_1941.png out.png
/home/franverona/torch/install/bin/luajit: /home/franverona/torch/install/share/lua/5.1/torch/File.lua:370: table index is nil
stack traceback:
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:370: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/nn/Module.lua:158: in function 'read'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:353: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:353: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    ...anverona/torch/install/share/lua/5.1/nngraph/gmodule.lua:482: in function 'read'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    /home/franverona/torch/install/share/lua/5.1/torch/File.lua:409: in function 'load'
    colorize.lua:23: in main chunk
    [C]: in function 'dofile'
    ...rona/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x0804cbc0
fyngyrz commented 8 years ago

Same here - I installed Torch from the Torch page when, in issue number 6, you indicated in your first reply that it should be done, so the install is very fresh.

Perhaps a minimal test file or files that would tell you something?

It seems notable that the load of the data is so fragile. Perhaps that indicates something else that the lack of fine-grained diagnostics in Lua and Torch hides that might be remediated with some test files?

bobbens commented 8 years ago

The error indicates that it is failing to load, but it doesn't give any details on why. Torch is research code and it wouldn't be surprising that there is some sort of compatibility issue. We are distributing the model in binary format due to size and it could be related to that. Are you by chance on a big-endian system?

franverona commented 8 years ago

Nope, little endian in my case.

fyngyrz commented 8 years ago

Same here. Dual 4-core Xeon.

bobbens commented 8 years ago

I have converted it to ascii. Try download the model at http://hi.cs.waseda.ac.jp/~esimo//files/colornet_ascii.t7.bz2 , uncompressing it (bunzip colornet_ascii.t7.bz2) and running (in torch, "th" command)

require 'nngraph'
data = torch.load( 'colornet_ascii.t7', 'ascii' )
franverona commented 8 years ago

It seems to work, but always breaks for my example images (1000x800) though.

Is there anything I can do to make it work? Maybe using GPU instead of pure CPU could do the job?

bobbens commented 8 years ago

If you want to do such large images, I recommend downscaling the input, running it through the model, then upscaling the output (chrominance) to match the original image (luminance) before fusing them together, as the current model was trained with rather small patches (dataset restriction). This will both give better results and take less time/memory than running directly on the large images. GPU is only faster than CPU, and usually runs out of memory.