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

t7 file open fails #8

Open
fyngyrz opened this issue May 4, 2016 · 10 comments
Open

t7 file open fails #8

fyngyrz opened this issue May 4, 2016 · 10 comments

Comments

@fyngyrz
Copy link

fyngyrz commented May 4, 2016

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

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

bobbens commented May 4, 2016

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

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

fyngyrz commented May 5, 2016

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

bobbens commented May 8, 2016

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

Nope, little endian in my case.

@fyngyrz
Copy link
Author

fyngyrz commented May 8, 2016

Same here. Dual 4-core Xeon.

@bobbens
Copy link
Collaborator

bobbens commented May 10, 2016

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

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

bobbens commented May 12, 2016

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.

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