luanfujun / deep-painterly-harmonization

Code and data for paper "Deep Painterly Harmonization": https://arxiv.org/abs/1804.03189
6.07k stars 626 forks source link

Nil Value #14

Open wel3kxial opened 6 years ago

wel3kxial commented 6 years ago

Get error neural_paint.lua:507: attempt to perform arithmetic on local 'sty_lev' (a nil value) stack traceback: neural_paint.lua:507: in function 'params_wikiart_genre' neural_paint.lua:101: in function 'main' neural_paint.lua:738: in main chunk [C]: in function 'dofile' ...itai/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x00405d50

Under Ubuntu 16.04 any suggestions?

gsssrao commented 6 years ago

This is because you are trying to run the code on a custom painting. It seems that in the current version of the repository, pre-trained model for computing stylisation weights hasn't been included. Refer README:

Note that in the paper we trained a CNN on a dataset of 80,000 paintings collected from wikiart.org, which estimates the stylization level of a given painting and adjust weights accordingly. We will release the pre-trained model in the next update. Users will need to set those weights manually if running on their new paintings for now.

Refer #11 for more details.

One option to make the code work is to set the weights manually here instead of calling params_wikiart_genre though this will be cumbersome and may need a lot of tweaking.