-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_tensorflow_python3.sh
101 lines (67 loc) · 2.06 KB
/
install_tensorflow_python3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
sudo apt-get update -y
sudo apt-get upgrade -y
clear
echo "system updated"
sleep 1
#installing libs
sudo apt-get install openjdk-8-jdk automake autoconf -y
sudo apt-get install curl zip unzip libtool swig libpng12-dev zlib1g-dev pkg-config git g++ wget xz-utils libatlas-base-dev -y
sudo apt-get update -y
clear
echo "libs utils installed"
sleep 1
#installing python3
sudo apt-get install python3-numpy python3-dev python3-pip python3-mock python3-setuptools -y
sudo apt-get update -y
clear
echo "python3 installed"
sleep 1
clear
echo "tensorflow downloaded"
sleep 2
if [ ! -f /home/ubuntu/get-pip.py ]; then
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
fi
pip install setuptools
pip install wheel
clear
echo "pip installed and pip packages"
sleep 2
#eviting erros
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get autoclean -y
sudo apt-get autoremove -y
clear
echo "All packages are installed"
sleep 2
#installing tensorflow
#downloading tensorflow 1.10
arch=`uname -m`
echo "$arch"
if [ "$arch" == "armv7l" ]; then
if [ ! -f /home/ubuntu/tensorflow-1.10.0-cp35-none-linux_armv7l.whl ]; then
wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.10.0/tensorflow-1.10.0-cp35-none-linux_armv7l.whl
pip install tensorflow-1.10.0-cp35-none-linux_armv7l.whl
rm tensorflow-1.10.0-cp35-none-linux_armv7l.whl
fi
fi
if [ "$arch" == "aarch64" ]; then
if [ ! -f /home/ubuntu/tensorflow-1.10.0-cp35-none-linux_aarch64.whl ]; then
wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.10.0/tensorflow-1.10.0-cp35-none-linux_aarch64.whl
pip install tensorflow-1.10.0-cp35-none-linux_aarch64.whl
rm tensorflow-1.10.0-cp35-none-linux_aarch64.whl
fi
fi
echo " Python packages installed. Testing..."
sudo python3 -c "import tensorflow as tf; print(tf.__version__);print('ok')"
sleep 1
echo "finished"
rm get-pip.py
sleep 10
df -h