From aaeb8841e2e1d44b560f6b3a5d97784e5d217b68 Mon Sep 17 00:00:00 2001 From: Ashutosh Parkhi Date: Thu, 15 Sep 2022 14:27:06 +0100 Subject: [PATCH] Fix for import requests and import caffe failures Recently virtual environments were introduced in the docker images. In this fix, link to the caffe is created inside this virtual env instead of being on the system path of python. This fix also removes importing request package where not needed. Change-Id: Ibadced591f95b93f5bf9bab6faa7d0ddb759e2f7 --- ci/scripts/github_skipped_tests_comment.py | 2 -- docker/install/ubuntu_install_caffe.sh | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ci/scripts/github_skipped_tests_comment.py b/ci/scripts/github_skipped_tests_comment.py index ef0630620b97..c07fbf4a8463 100755 --- a/ci/scripts/github_skipped_tests_comment.py +++ b/ci/scripts/github_skipped_tests_comment.py @@ -24,8 +24,6 @@ from urllib import error from xml.etree import ElementTree -import requests - from git_utils import git, GitHubRepo, parse_remote from cmd_utils import init_log diff --git a/docker/install/ubuntu_install_caffe.sh b/docker/install/ubuntu_install_caffe.sh index c37bfb764935..4d9763b69aa3 100755 --- a/docker/install/ubuntu_install_caffe.sh +++ b/docker/install/ubuntu_install_caffe.sh @@ -18,6 +18,11 @@ set -euxo pipefail +if [ -z "${TVM_VENV+x}" ]; then + echo "ERROR: expect TVM_VENV env var to be set" + exit 2 +fi + apt-get update --fix-missing # # Install dependencies @@ -60,4 +65,5 @@ cd / && rm -rf /caffe_src PYCAFFE_ROOT=${CAFFE_HOME}/python echo "${CAFFE_HOME}/lib" >> /etc/ld.so.conf.d/caffe.conf && ldconfig -ln -s ${PYCAFFE_ROOT}/caffe /usr/local/lib/python3.7/dist-packages/caffe +VENV_SITE_PACKAGE=$(pip3 show numpy | grep "Location:" | cut -d ' ' -f 2) +ln -s ${PYCAFFE_ROOT}/caffe ${VENV_SITE_PACKAGE}/caffe