From f0a12e80e98da63bce2903d895ea2a65b1ecad65 Mon Sep 17 00:00:00 2001 From: Liangliang He Date: Thu, 16 May 2019 10:50:29 +0800 Subject: [PATCH] Install python2.7 to make mobile-ai-bench code work --- docker/mace-dev/Dockerfile | 34 ++++++++++++++++++++++++++++++++++ tools/device.py | 4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/docker/mace-dev/Dockerfile b/docker/mace-dev/Dockerfile index d65627c2..9669613d 100644 --- a/docker/mace-dev/Dockerfile +++ b/docker/mace-dev/Dockerfile @@ -81,3 +81,37 @@ ENV ANDROID_NDK_HOME /opt/android-ndk-${ANDROID_NDK_VERSION} ENV LINARO_ARM_LINUX_GNUEABIHF /opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf ENV LINARO_AARCH64_LINUX_GNU /opt/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu ENV PATH /opt/protoc-3.6.1/bin:${PATH} + + +RUN pyenv install 2.7.12 +RUN pyenv global 2.7.12 +RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com --upgrade pip setuptools +RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ + numpy==1.15.4 \ + scipy==1.2.0 \ + Jinja2==2.10 \ + PyYAML==3.13 \ + sh==1.12.14 \ + pycodestyle==2.4.0 \ + filelock==3.0.10 \ + PTable==0.9.2 + +RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ + tensorflow==1.8.0 + +# Install pytorch (refer to: https://pytorch.org/get-started/locally/) +RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ + future==0.17.1 \ + Pillow==5.4.1 \ + torch==1.1.0 \ + torchvision==0.2.2.post3 + +RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ + onnx==1.3.0 \ + onnx-tf==1.2.0 + +RUN pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \ + cpplint==1.4.4 + +# Restore to python3 +RUN pyenv global 3.6.3 diff --git a/tools/device.py b/tools/device.py index ef0225f9..00f3aa37 100644 --- a/tools/device.py +++ b/tools/device.py @@ -244,8 +244,8 @@ class DeviceWrapper: stderr=subprocess.PIPE, stdout=subprocess.PIPE) out, err = p.communicate() - out = str(out, encoding = 'utf-8') - err = str(err, encoding = 'utf-8') + out = str(out, encoding='utf-8') + err = str(err, encoding='utf-8') self.stdout = err + out six.print_(self.stdout) six.print_("Running finished!\n") -- GitLab