Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit adb9f6f

Browse files
authored
Merge pull request #1251 from Nov11/fix-tensorflow-install-ubuntu1710
fix 'not a supported wheel on this platform' error when running package.sh on Ubuntu 17.10
2 parents b8bf0bb + e6c1a2c commit adb9f6f

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

script/installation/packages.sh

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ function install_protobuf3.4.0() {
6767
# Utility function for installing tensorflow components of python/C++
6868
function install_tf() {
6969
TFCApiFile=$1
70-
TFBinaryURL=$2
70+
TF_VERSION=$2
7171
LinkerConfigCmd=$3
7272
TARGET_DIRECTORY="/usr/local"
7373
# Install Tensorflow Python Binary
74-
sudo -E pip3 install --upgrade ${TFBinaryURL}
74+
sudo -E pip3 install --upgrade pip
75+
sudo -E pip3 install --upgrade tensorflow==${TF_VERSION}
7576

7677
# Install C-API
7778
TFCApiURL="https://storage.googleapis.com/tensorflow/libtensorflow/${TFCApiFile}"
@@ -88,7 +89,6 @@ function install_tf() {
8889
## ------------------------------------------------
8990
if [ "$DISTRO" = "UBUNTU" ]; then
9091
MAJOR_VER=$(echo "$DISTRO_VER" | cut -d '.' -f 1)
91-
9292
# Fix for LLVM-3.7 on Ubuntu 14 + 17
9393
if [ "$MAJOR_VER" == "14" -o "$MAJOR_VER" == "17" ]; then
9494
if [ "$MAJOR_VER" == "14" ]; then
@@ -120,19 +120,16 @@ if [ "$DISTRO" = "UBUNTU" ]; then
120120
if [ "$MAJOR_VER" == "14" ]; then
121121
PKG_CMAKE="cmake3"
122122
FORCE_Y="--force-yes"
123-
TF_VERSION="1.4.0"
124-
TFBinaryURL="https://storage.googleapis.com/tensorflow/linux/${TF_TYPE}/tensorflow-${TF_VERSION}-cp34-cp34m-linux_x86_64.whl"
123+
TF_VERSION="1.4.0"
125124
fi
126125
if [ "$MAJOR_VER" == "16" ]; then
127-
TF_VERSION="1.5.0"
128-
TFBinaryURL="https://storage.googleapis.com/tensorflow/linux/${TF_TYPE}/tensorflow-${TF_VERSION}-cp35-cp35m-linux_x86_64.whl"
126+
TF_VERSION="1.5.0"
129127
fi
130128
# Fix for llvm on Ubuntu 17.x
131129
if [ "$MAJOR_VER" == "17" ]; then
132130
PKG_LLVM="llvm-3.9"
133131
PKG_CLANG="clang-3.8"
134-
TF_VERSION="1.5.0"
135-
TFBinaryURL="https://storage.googleapis.com/tensorflow/linux/${TF_TYPE}/tensorflow-${TF_VERSION}-cp35-cp35m-linux_x86_64.whl"
132+
TF_VERSION="1.5.0"
136133
fi
137134
TFCApiFile="libtensorflow-${TF_TYPE}-linux-x86_64-${TF_VERSION}.tar.gz"
138135
LinkerConfigCmd="sudo ldconfig"
@@ -168,7 +165,7 @@ if [ "$DISTRO" = "UBUNTU" ]; then
168165
# Install version of protobuf needed by C-API
169166
install_protobuf3.4.0 "ubuntu"
170167
# Install tensorflow
171-
install_tf "$TFCApiFile" "$TFBinaryURL" "$LinkerConfigCmd"
168+
install_tf "$TFCApiFile" "$TF_VERSION" "$LinkerConfigCmd"
172169

173170
## ------------------------------------------------
174171
## DEBIAN
@@ -208,7 +205,6 @@ elif [[ "$DISTRO" == *"FEDORA"* ]]; then
208205
esac
209206
TF_VERSION="1.5.0"
210207
TFCApiFile="libtensorflow-${TF_TYPE}-linux-x86_64-${TF_VERSION}.tar.gz"
211-
TFBinaryURL="https://storage.googleapis.com/tensorflow/linux/${TF_TYPE}/tensorflow-${TF_VERSION}-cp36-cp36m-linux_x86_64.whl"
212208
LinkerConfigCmd="sudo ldconfig"
213209
sudo dnf -q install -y \
214210
git \
@@ -244,7 +240,7 @@ elif [[ "$DISTRO" == *"FEDORA"* ]]; then
244240
# Install version of protobuf needed by C-API
245241
install_protobuf3.4.0 "fedora"
246242
# Install tensorflow
247-
install_tf "$TFCApiFile" "$TFBinaryURL" "$LinkerConfigCmd"
243+
install_tf "$TFCApiFile" "$TF_VERSION" "$LinkerConfigCmd"
248244

249245
## ------------------------------------------------
250246
## REDHAT
@@ -325,7 +321,6 @@ elif [ "$DISTRO" = "DARWIN" ]; then
325321
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
326322
fi
327323
TF_VERSION="1.4.0"
328-
TFBinaryURL="https://storage.googleapis.com/tensorflow/mac/${TF_TYPE}/tensorflow-${TF_VERSION}-py3-none-any.whl"
329324
TFCApiFile="libtensorflow-${TF_TYPE}-darwin-x86_64-${TF_VERSION}.tar.gz"
330325
LinkerConfigCmd="sudo update_dyld_shared_cache"
331326
brew install git
@@ -349,7 +344,7 @@ elif [ "$DISTRO" = "DARWIN" ]; then
349344
brew upgrade python
350345
# Brew installs correct version of Protobuf(3.5.1 >= 3.4.0)
351346
# So we can directly install tensorflow
352-
install_tf "$TFCApiFile" "$TFBinaryURL" "$LinkerConfigCmd"
347+
install_tf "$TFCApiFile" "$TF_VERSION" "$LinkerConfigCmd"
353348

354349
## ------------------------------------------------
355350
## UNKNOWN

0 commit comments

Comments
 (0)