I get a black picture
sukerlove opened this issue · 4 comments
I follow your Setup list , but
import make_image
make_image.make_image('test_pics/city.jpg', '9', 'out/9_city.jpg')
get a black picture
is there any env wrong ?
suker@suker:neural_style$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import make_image
make_image.make_image('test_pics/city.jpg', '9', 'out/91_city.jpg')
/usr/local/lib/python2.7/dist-packages/skimage/io/_io.py:132: UserWarning: out/91_city.jpg is a low contrast image
warn('%s is a low contrast image' % fname)
Sorry, I don't know what happened. I never seen this before. How about other models? Did other models give black output too?
Can you add print out[0,:,:4,:4]
under https://github.com/zhaw/neural_style/blob/master/make_image.py#L62 and show me the output?
@zhaw
thanks for reply
i use The method you said, here the output
make_image.make_image('test_pics/city.jpg', '9', 'out/9_city.jpg')
[[[ nan nan nan nan]
[ nan nan nan nan]
[ nan nan nan nan]
[ nan nan nan nan]]
[[ 0.04053016 0.04053016 0.04053016 0.04053016]
[ 0.04053016 0.04053016 0.04053016 0.04053016]
[ 0.04053016 0.04053016 0.04053016 0.04053016]
[ 0.04053016 0.04053016 0.04053016 0.04053016]]
[[ 0.3389678 0.3389678 0.3389678 0.3389678 ]
[ 0.3389678 0.3389678 0.3389678 0.3389678 ]
[ 0.3389678 0.3389678 0.3389678 0.3389678 ]
[ 0.3389678 0.3389678 0.3389678 0.3389678 ]]]
/usr/local/lib/python2.7/dist-packages/skimage/io/_io.py:132: UserWarning: out/9_city.jpg is a low contrast image
warn('%s is a low contrast image' % fname)
make_image.make_image('test_pics/city.jpg', '8', 'out/8_city.jpg')
[[[ nan nan nan nan]
[ nan nan nan nan]
[ nan nan nan nan]
[ nan nan nan nan]]
[[-0.29516593 -0.29516593 -0.29516593 -0.29516593]
[-0.29516593 -0.29516593 -0.29516593 -0.29516593]
[-0.29516593 -0.29516593 -0.29516593 -0.29516593]
[-0.29516593 -0.29516593 -0.29516593 -0.29516593]]
[[-0.8966462 -0.8966462 -0.8966462 -0.8966462 ]
[-0.8966462 -0.8966462 -0.8966462 -0.8966462 ]
[-0.8966462 -0.8966462 -0.8966462 -0.8966462 ]
[-0.8966462 -0.8966462 -0.8966462 -0.8966462 ]]]
I found one thing that leads to an error, but not exactly yours.
Which Cudnn version are you using? I found that this repo is not compatible with Cudnn v5, you have to use Cudnn v4. Lower version may also work, I didn't find the download link on CUDA page.
I'm using another computer to test. Besides the error above, everything works fine.
@zhaw
thanks
I check my env, it's use cudnn v4
suker@suker:neural_style$ ls -la /usr/local/cuda/lib64/ | grep cudnn
lrwxrwxrwx 1 root root 35 9月 6 16:28 libcudnn.so -> /usr/local/cuda/lib64/libcudnn.so.4
lrwxrwxrwx 1 root root 39 8月 16 14:28 libcudnn.so.4 -> /usr/local/cuda/lib64/libcudnn.so.4.0.7
-rwxr-xr-x 1 root root 61453024 8月 16 14:15 libcudnn.so.4.0.7
lrwxrwxrwx 1 root root 39 8月 16 10:38 libcudnn.so.5 -> /usr/local/cuda/lib64/libcudnn.so.5.1.5
-rwxr-xr-x 1 root root 79337624 8月 11 18:42 libcudnn.so.5.1.5
lrwxrwxrwx 1 root root 33 9月 7 15:33 libcudnn.so.6.5 -> /usr/local/cuda/lib64/libcudnn.so
lrwxrwxrwx 1 root root 40 9月 6 16:17 libcudnn.so.7.0 -> /usr/local/cuda/lib64/libcudnn.so.7.0.64
-rwxr-xr-x 1 root root 48217000 8月 16 11:05 libcudnn.so.7.0.64
-rw-r--r-- 1 root root 62025862 9月 6 16:28 libcudnn_static.a
suker@suker:neural_style$
make_image.make_image('test_pics/city.jpg', '11', 'out/11_city.jpg')
[[[-0.65209335 -0.65209335 -0.65209335 -0.65209335]
[-0.65209335 -0.65209335 -0.65209335 -0.65209335]
[-0.65209335 -0.65209335 -0.65209335 -0.65209335]
[-0.65209335 -0.65209335 -0.65209335 -0.65209335]]
[[ 0.17108847 0.17108847 0.17108847 0.17108847]
[ 0.17108847 0.17108847 0.17108847 0.17108847]
[ 0.17108847 0.17108847 0.17108847 0.17108847]
[ 0.17108847 0.17108847 0.17108847 0.17108847]]
[[ 0.56871575 0.56871575 0.56871575 0.56871575]
[ 0.56871575 0.56871575 0.56871575 0.56871575]
[ 0.56871575 0.56871575 0.56871575 0.56871575]
[ 0.56871575 0.56871575 0.56871575 0.56871575]]]
/usr/local/lib/python2.7/dist-packages/skimage/io/_io.py:132: UserWarning: out/11_city.jpg is a low contrast image
warn('%s is a low contrast image' % fname)