Exception: could not convert string to float while running comparison demo
Closed this issue · 0 comments
Hi,
I tried to build openface image on arm64 platform using the below Dockerfile:
Dockerfile:
`
FROM ubuntu:14.04
RUN set -xe && echo '#!/bin/sh' > /usr/sbin/policy-rc.d && echo 'exit 101' >> /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d && dpkg-divert --local --rename --add /sbin/initctl && cp -a /usr/sbin/policy-rc.d /sbin/initctl && sed -i 's/^exit./exit 0/' /sbin/initctl && echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/.deb /var/cache/apt/archives/partial/.deb /var/cache/apt/.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean && echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/.deb /var/cache/apt/archives/partial/.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean && echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean && echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes
RUN rm -rf /var/lib/apt/lists/*
RUN sed -i 's/^#\s*(deb.*universe)$/\1/g' /etc/apt/sources.list
CMD ["/bin/bash"]
MAINTAINER Brandon Amos brandon.amos.cs@gmail.com
RUN apt-get update && apt-get install -y build-essential cmake curl gfortran git graphicsmagick libgraphicsmagick1-dev libatlas-dev libavcodec-dev libavformat-dev libboost-all-dev libgtk2.0-dev libjpeg-dev liblapack-dev libswscale-dev pkg-config python-dev python-numpy python-protobuf software-properties-common zip && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps > requirements
RUN sed -i 's/libopenblas-dev/libblas-dev/g' requirements
RUN chmod +x requirements && ./requirements
RUN git clone https://github.com/torch/distro.git ~/torch --recursive
RUN cd ~/torch && TORCH_LUA_VERSION=LUA51 ./install.sh && cd install/bin && ./luarocks install nn && ./luarocks install dpnn && ./luarocks install image && ./luarocks install optim && ./luarocks install csvigo && ./luarocks install torchx && ./luarocks install tds
RUN cd ~ && mkdir -p ocv-tmp && cd ocv-tmp && curl -L https://github.com/Itseez/opencv/archive/2.4.11.zip -o ocv.zip && unzip ocv.zip && cd opencv-2.4.11 && mkdir release && cd release && cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON .. && make -j8 && make install && rm -rf ~/ocv-tmp
RUN cd ~ && mkdir -p dlib-tmp && cd dlib-tmp && curl -L https://github.com/davisking/dlib/archive/v19.0.tar.gz -o dlib.tar.bz2 && tar xf dlib.tar.bz2 && cd dlib-19.0/python_examples && mkdir build && cd build && cmake ../../tools/python && cmake --build . --config Release && cp dlib.so /usr/local/lib/python2.7/dist-packages && rm -rf ~/dlib-tmp
MAINTAINER Brandon Amos brandon.amos.cs@gmail.com
RUN ln -s /root/torch/install/bin/* /usr/local/bin
RUN apt-get update && apt-get install -y curl git graphicsmagick libssl-dev libffi-dev python-dev python-pip python-numpy python-nose python-scipy python-pandas python-protobuf python-openssl wget zip && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ADD . /root/openface
RUN sudo apt-get update
RUN pip install pysocks
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py && python get-pip.py
RUN sudo pip install --upgrade pip && pip install setuptools==18.5
RUN cd ~/openface && chmod +x ./models/get-models.sh && ./models/get-models.sh
RUN cd ~/openface && pip2 install -r requirements.txt
RUN cd ~/openface && python2 setup.py install
RUN cd ~/openface && pip2 install --user --ignore-installed -r demos/web/requirements.txt
RUN cd ~/openface && pip2 install -r training/requirements.txt
EXPOSE 8000/tcp 9000/tcp
RUN chmod +x /root/openface/demos/web/start-servers.sh
CMD /bin/bash -l -c '/root/openface/demos/web/start-servers.sh'
`
I was able to successfully built the openface image on ARM64 platform.
I used the below command to create container:
docker run --name openface -p 8000:8000 -p 9000:9000 --restart=always -itd #imageName
Next, I ran the sample demo inside the openface container.
I am getting the below issue when I run the command:
Command: python demos/compare.py images/examples/{adams.jpg,carell.jpg}
Output:
**Error getting result from Torch subprocess.
Line read:
Exception:
could not convert string to float:
============
stdout**
Steps to reproduce.
Follow the steps which I mentioned above.
Run the below command to reproduce this issue.
python demos/compare.py images/examples/{adams.jpg,carell.jpg}
OS and hardware information.
- Operating system: Ubuntu 14.04.6 LTS
- Torch version: 7
- CPU architecture: aarch64