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

Exception: could not convert string to float while running comparison demo #440

Open
mansi-jain2 opened this issue Apr 15, 2021 · 0 comments

Comments

@mansi-jain2
Copy link

mansi-jain2 commented Apr 15, 2021

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 [email protected]

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 [email protected]

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
@mansi-jain2 mansi-jain2 changed the title Exception: could not convert string to float while executing comparison demo Exception: could not convert string to float while runningcomparison demo Apr 15, 2021
@mansi-jain2 mansi-jain2 changed the title Exception: could not convert string to float while runningcomparison demo Exception: could not convert string to float while running comparison demo Apr 15, 2021
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

1 participant