dsanno / chainer-neural-style

implementation of neural style using Chainer
Other
18 stars 6 forks source link

Strange error #7

Open dovanchan opened 7 years ago

dovanchan commented 7 years ago

When I try to transfer a phoho with this command: DOVANtekiMacBook-Pro:chainer-neural-style DOVAN$ time python src/run.py -c /Users/DOVAN/Desktop/model.png -s /Users/DOVAN/Desktop/111.png -o /Users/DOVAN/Desktop/chai/modelcat -g -1 --match_color_histogram

loading content image completed /Users/DOVAN/deeprely/chainer-neural-style/src/util.py:113: RuntimeWarning: invalid value encountered in sqrt b_sigma = v.dot(np.diag(d * 0.5)).dot(v.T) loading style image completed loading neural network model completed /Users/DOVAN/anaconda2/lib/python2.7/site-packages/chainer/functions/activation/relu.py:44: RuntimeWarning: invalid value encountered in greater return utils.force_array(gy[0] (x[0] > 0)), epoch 100 done losses: content_4_2: nan style_1_2 : nan style_2_2 : nan style_3_2 : nan style_4_2 : nan tv : nan epoch 200 done losses: content_4_2: nan style_1_2 : nan style_2_2 : nan style_3_2 : nan style_4_2 : nan tv : nan epoch 300 done losses: content_4_2: nan style_1_2 : nan style_2_2 : nan style_3_2 : nan style_4_2 : nan tv : nan

Why all of loss are nan ~; It's a bug in --match_color_histogram ? (without this match_color,everything is fine)

dsanno commented 7 years ago

It seems that gray scale image causes the problem. I fixed it in aecabb6f584bb9a43ba965fa9cb010654426813d, and can you try again? If the same problem occurs, please tell me your style image. I think this problem depends on style image.