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

deepdream-cli-docker hangs in ubuntu 18.04 #4

Open
bwanaaa opened this issue Mar 23, 2019 · 3 comments
Open

deepdream-cli-docker hangs in ubuntu 18.04 #4

bwanaaa opened this issue Mar 23, 2019 · 3 comments

Comments

@bwanaaa
Copy link

bwanaaa commented Mar 23, 2019

I successfully installed docker community edition and it runs fine. Even added myself as a user so I dont have to type sudo before every docker command. I start with

cat /home/stefan/Pictures/DSC_1789.JPG | docker run -i saturnism/deepdream-cli > output.jpg

and get

libdc1394 error: Failed to initialize libdc1394
/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
WARNING: Logging before InitGoogleLogging() is written to STDERR
W0323 17:52:28.385108     1 _caffe.cpp:122] DEPRECATION WARNING - deprecated use of Python interface
W0323 17:52:28.385124     1 _caffe.cpp:123] Use this instead (with the named "weights" parameter):
W0323 17:52:28.385126     1 _caffe.cpp:125] Net('tmp.prototxt', 1, weights='caffe/models/bvlc_googlenet/bvlc_googlenet.caffemodel')
I0323 17:52:28.388671     1 net.cpp:58] Initializing net from parameters: 
name: "GoogleNet"
force_backward: true

.
.
.
.
lots of stuf
.
.
.
.

I0323 17:52:28.438112     1 net.cpp:283] Network initialization done.
I0323 17:52:28.544561     1 upgrade_proto.cpp:52] Attempting to upgrade input file specified using deprecated V1LayerParameter: caffe/models/bvlc_googlenet/bvlc_googlenet.caffemodel
I0323 17:52:28.577404     1 upgrade_proto.cpp:60] Successfully upgraded file specified using deprecated V1LayerParameter
I0323 17:52:28.577956     1 net.cpp:761] Ignoring source layer label_data_1_split
I0323 17:52:28.578555     1 net.cpp:761] Ignoring source layer loss1/ave_pool
I0323 17:52:28.578560     1 net.cpp:761] Ignoring source layer loss1/conv
I0323 17:52:28.578562     1 net.cpp:761] Ignoring source layer loss1/relu_conv
I0323 17:52:28.578564     1 net.cpp:761] Ignoring source layer loss1/fc
I0323 17:52:28.578567     1 net.cpp:761] Ignoring source layer loss1/relu_fc
I0323 17:52:28.578567     1 net.cpp:761] Ignoring source layer loss1/drop_fc
I0323 17:52:28.578570     1 net.cpp:761] Ignoring source layer loss1/classifier
I0323 17:52:28.578572     1 net.cpp:761] Ignoring source layer loss1/loss
I0323 17:52:28.579334     1 net.cpp:761] Ignoring source layer loss2/ave_pool
I0323 17:52:28.579339     1 net.cpp:761] Ignoring source layer loss2/conv
I0323 17:52:28.579340     1 net.cpp:761] Ignoring source layer loss2/relu_conv
I0323 17:52:28.579342     1 net.cpp:761] Ignoring source layer loss2/fc
I0323 17:52:28.579344     1 net.cpp:761] Ignoring source layer loss2/relu_fc
I0323 17:52:28.579346     1 net.cpp:761] Ignoring source layer loss2/drop_fc
I0323 17:52:28.579349     1 net.cpp:761] Ignoring source layer loss2/classifier
I0323 17:52:28.579350     1 net.cpp:761] Ignoring source layer loss2/loss
I0323 17:52:28.581341     1 net.cpp:761] Ignoring source layer loss3/loss3
/usr/lib/python2.7/dist-packages/scipy/ndimage/interpolation.py:532: UserWarning: From scipy 0.13.0, the output shape of zoom() is calculated with round() instead of int() - for these inputs the size of the returned array has changed.
  "the returned array has changed.", UserWarning)

and then it just hangs there

htop shows this

https://imgur.com/yAkmA7D

Waiting 15' nothing happens

ctrl-C and I get


Traceback (most recent call last):
  File "./deepdream.py", line 135, in <module>
    out = deepdream(net, img, end=options.layer, iter_n=options.iterations, octave_n=options.octaves, octave_scale=options.scale)
  File "./deepdream.py", line 116, in deepdream
    make_step(net, end=end, clip=clip, **step_params)
  File "./deepdream.py", line 86, in make_step
    net.backward(start=end)
  File "/deepdream/caffe/distribute/python/caffe/pycaffe.py", line 169, in _Net_backward
    self._backward(start_ind, end_ind)
KeyboardInterrupt

Interestingly, when I run this

cat /home/stefan/Pictures/DSC_1789.JPG | docker run saturnism/deepdream-cli > output.jpg

(notice the absence of the -i flag) I get this error

Traceback (most recent call last):
  File "./deepdream.py", line 134, in <module>
    img = np.float32(PIL.Image.open(StringIO(sys.stdin.read())))
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2028, in open
    raise IOError("cannot identify image file")
IOError: cannot identify image file

and when I run this

cat /home/stefan/Pictures/DSC_1789.JPG | docker run -iterations=1 saturnism/deepdream-cli > output.jpg

(notice -iterations=1 flag)

I get

the input device is not a TTY

running

docker run -i saturnism/deepdream-cli -h

gives


libdc1394 error: Failed to initialize libdc1394
/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
Usage: deepdream.py [options]

Options:
  -h, --help            show this help message and exit
  -i ITERATIONS, --iterations=ITERATIONS
                        Iterations
  -o OCTAVES, --octaves=OCTAVES
                        Octatves
  -s SCALE, --scale=SCALE
                        Octatves Scale
  -l LAYER, --layer=LAYER
                        Layer
  --layers              Display layers

but none of the other flags (-o, -s, -l, --layers) work

@saturnism
Copy link
Owner

and when I run this

cat /home/stefan/Pictures/DSC_1789.JPG | docker run -iterations=1 saturnism/deepdream-cli > output.jpg

(notice -iterations=1 flag)

I get

the input device is not a TTY

This is because you put -iterations as a flag for docker run. The flag needs to be set for the container instance, docker run -i saturnism/deepdream-cli --iterations=1 ...

@saturnism
Copy link
Owner

htop shows this

https://imgur.com/yAkmA7D

Waiting 15' nothing happens

it looks like it's using 100% of 1 of the CPUs. The process does take some time. Can you try a smaller photo/picture?

@bwanaaa
Copy link
Author

bwanaaa commented Mar 24, 2019

thank you for your replies. I am learning still about docker.

I resized the image to 400x300 pixels. The command executed to completion in 2 minutes. I thought I was in for another hang since the last lines I saw were:

/usr/lib/python2.7/dist-packages/scipy/ndimage/interpolation.py:532: UserWarning: From scipy 0.13.0, the output shape of zoom() is calculated with round() instead of int() - for these inputs the size of the returned array has changed.
  "the returned array has changed.", UserWarning)

but then I got the bash prompt back. whew.

I appreciate the work you put into the notebook as well. In it, you listed all the layers that the algorithm develops. I modified the script to loop through them all. Some interesting variations. However, some of the layers fail - specifically the ones with the word 'split' at the end

but then

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

2 participants