yahoo / open_nsfw

Not Suitable for Work (NSFW) classification using deep neural network Caffe models.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building docker image fails

4goettma opened this issue · comments

$> docker build -t caffe:cpu https://raw.githubusercontent.com/BVLC/caffe/master/docker/cpu/Dockerfile
[...]
Get:469 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libopencv2.4-jni amd64 2.4.9.1+dfsg-1.5ubuntu1.1 [148 kB]
Get:470 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libopencv2.4-java all 2.4.9.1+dfsg-1.5ubuntu1.1 [433 kB]
Get:471 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libopencv-dev amd64 2.4.9.1+dfsg-1.5ubuntu1.1 [169 kB]
Get:472 http://archive.ubuntu.com/ubuntu xenial/main amd64 libprotobuf-lite9v5 amd64 2.6.1-1.3 [58.4 kB]
Get:473 http://archive.ubuntu.com/ubuntu xenial/main amd64 libprotobuf9v5 amd64 2.6.1-1.3 [326 kB]
Get:474 http://archive.ubuntu.com/ubuntu xenial/main amd64 libprotoc9v5 amd64 2.6.1-1.3 [273 kB]
Get:475 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-decorator all 4.0.6-1 [9326 B]
Get:476 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-numpy amd64 1:1.11.0-1ubuntu1 [1763 kB]
Get:477 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-pip-whl all 8.1.1-2ubuntu0.4 [1110 kB]
Get:478 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-pip all 8.1.1-2ubuntu0.4 [144 kB]
Get:479 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-pkg-resources all 20.7.0-1 [108 kB]
Get:480 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-setuptools all 20.7.0-1 [169 kB]
Get:481 http://archive.ubuntu.com/ubuntu xenial/main amd64 libprotobuf-dev amd64 2.6.1-1.3 [473 kB]
Get:482 http://archive.ubuntu.com/ubuntu xenial/main amd64 libsnappy-dev amd64 1.1.3-2 [24.0 kB]
Get:483 http://archive.ubuntu.com/ubuntu xenial/main amd64 protobuf-compiler amd64 2.6.1-1.3 [20.4 kB]
Get:484 http://archive.ubuntu.com/ubuntu xenial/universe amd64 python-scipy amd64 0.17.0-1 [8733 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 234 MB in 10s (23.3 MB/s)
(Reading database ... 4768 files and directories currently installed.)
Preparing to unpack .../perl-base_5.22.1-9ubuntu0.6_amd64.deb ...
Unpacking perl-base (5.22.1-9ubuntu0.6) over (5.22.1-9ubuntu0.5) ...
dpkg: error processing archive /var/cache/apt/archives/perl-base_5.22.1-9ubuntu0.6_amd64.deb (--unpack):
 unable to make backup link of './usr/share/lintian/overrides/perl-base' before installing new version: Invalid cross-device link
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
dpkg: error: error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
E: Sub-process /usr/bin/dpkg returned an error code (2)
The command '/bin/sh -c apt-get update && apt-get install -y --no-install-recommends         build-essential         cmake         git         wget         libatlas-base-dev         libboost-all-dev         libgflags-dev         libgoogle-glog-dev         libhdf5-serial-dev         libleveldb-dev         liblmdb-dev         libopencv-dev         libprotobuf-dev         libsnappy-dev         protobuf-compiler         python-dev         python-numpy         python-pip         python-setuptools         python-scipy &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

Seems to be BVLC's responsibility.

Seems to be BVLC's responsibility.

I think it has something to do with Kernel 4.19, see also docker/for-linux#480.
In the end I came up writing my own Dockerfile which uses an Arch Linux image, installs dependencies I compiled from the Arch User Repository on a real machine and installs open_nsfw via python-pip.

My dockerfile:
https://gist.githubusercontent.com/4goettma/098c10468abe6472fe4250824d37feaf/raw/ed1e07aa7bb0fc2c825df6987071df98a01811cd/Dockerfile

Python package:
https://pypi.org/project/nsfw/

Thanks for that info, I ended up using this fork which works fine https://github.com/rahiel/open_nsfw--