28
28
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
30
30
# Install Deep learning frameworks
31
+ # https://www.elinux.org/Jetson_TX2
31
32
32
33
# Tensorflow for jetson
33
34
# https://github.com/peterlee0127/tensorflow-nvJetson
34
35
# https://www.jetsonhacks.com/2017/03/24/caffe-deep-learning-framework-nvidia-jetson-tx2/
35
- # caffe2
36
- # https://github.com/caffe2/caffe2
36
+ # Torch7
37
+ # http://torch.ch/
38
+ # https://github.com/dusty-nv/jetson-reinforcement/blob/master/CMakePreBuild.sh
37
39
# Pytorch
40
+ # https://pytorch.org/
38
41
# https://gist.github.com/dusty-nv/ef2b372301c00c0a9d3203e42fd83426#file-pytorch_jetson_install-sh
42
+ # Jetson-Inference
43
+ # https://github.com/dusty-nv/jetson-inference
39
44
40
45
# Default variables load
41
46
MODULE_NAME=" Install deep learning frameworks"
@@ -45,6 +50,72 @@ MODULE_OPTIONS=("RUN" "STOP")
45
50
46
51
MODULE_SUBMENU=(" Install deep learning module:dp_learning_list" " Set install folder:dp_set_install_folder" )
47
52
53
+ dp_is_enabled ()
54
+ {
55
+ if [[ $DP_PATCH_LIST = * " $1 " * ]] ; then
56
+ echo " ON"
57
+ else
58
+ echo " OFF"
59
+ fi
60
+ }
61
+
62
+ script_run ()
63
+ {
64
+
65
+ if [ $( dp_is_enabled " tensorflow" ) == " ON" ] ; then
66
+ tput setaf 6
67
+ echo " Install tensorflow"
68
+ tput sgr0
69
+ dp_install_tensorflow
70
+ fi
71
+
72
+ if [ $( dp_is_enabled " pyTorch" ) == " ON" ] ; then
73
+ tput setaf 6
74
+ echo " Install pyTorch"
75
+ tput sgr0
76
+ dp_install_pytorch
77
+ fi
78
+
79
+ if [ $( dp_is_enabled " jetson-inference" ) == " ON" ] ; then
80
+ tput setaf 6
81
+ echo " Install jetson-inference"
82
+ tput sgr0
83
+ dp_install_jetson_inference
84
+ fi
85
+ }
86
+
87
+ dp_install_jetson_inference ()
88
+ {
89
+ # Local folder
90
+ local LOCAL_FOLDER=$( pwd)
91
+
92
+ tput setaf 6
93
+ echo " Install git and cmake"
94
+ tput sgr0
95
+ sudo apt-get install git cmake
96
+
97
+ tput setaf 6
98
+ echo " Clone jetson-inference repository from @dusty-nv"
99
+ tput sgr0
100
+ git clone https://github.com/dusty-nv/jetson-inference
101
+
102
+ tput setaf 6
103
+ echo " Configuring CMAKE"
104
+ tput sgr0
105
+ cd jetson-inference
106
+ mkdir build
107
+ cd build
108
+ cmake ../
109
+
110
+ tput setaf 6
111
+ echo " Make jetson-inference"
112
+ tput sgr0
113
+ make
114
+
115
+ # Restore previuous folder
116
+ cd $LOCAL_FOLDER
117
+ }
118
+
48
119
dp_install_pytorch ()
49
120
{
50
121
# Local folder
@@ -100,7 +171,7 @@ dp_install_tensorflow()
100
171
tput setaf 6
101
172
echo " Download and install pip"
102
173
tput sgr0
103
- wget https://bootstrap.pypa.io/get-pip.py -o get-pip.py
174
+ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
104
175
sudo python get-pip.py
105
176
106
177
tput setaf 6
@@ -109,7 +180,7 @@ dp_install_tensorflow()
109
180
echo " Thanks @peterlee0127"
110
181
tput sgr0
111
182
# Download last version of tensor flow
112
- wget https://github.com/peterlee0127/tensorflow-nvJetson/releases/download/binary/$DP_TENSORFLOW
183
+ wget --output-document $DP_TENSORFLOW https://github.com/peterlee0127/tensorflow-nvJetson/releases/download/binary/$DP_TENSORFLOW
113
184
114
185
tput setaf 6
115
186
echo " Install Tensorflow $DP_TENSORFLOW "
@@ -165,38 +236,29 @@ script_info()
165
236
echo " - Installation folder: $DP_FOLDER "
166
237
}
167
238
168
- dp_is_enabled ()
169
- {
170
- if [[ $PKGS_PATCH_LIST = * " $1 " * ]] ; then
171
- echo " ON"
172
- else
173
- echo " OFF"
174
- fi
175
- }
176
-
177
239
dp_learning_list ()
178
240
{
179
241
if [ -z ${DP_PATCH_LIST+x} ] ; then
180
242
# Empty kernel patch list
181
243
DP_PATCH_LIST=" \"\" "
182
244
fi
183
245
246
+ # "caffe" "A fast open framework" $(dp_is_enabled "caffe") \
247
+ # "caffe2" "Lightweight, modular, and scalable" $(dp_is_enabled "caffe2") \
248
+ # "torch7" "Scientific computing framework" $(dp_is_enabled "torch7") \
249
+
184
250
local PKGS_PATCH_LIST_TMP
185
251
DP_PATCH_LIST_TMP=$( whiptail --title " $MODULE_NAME " --checklist \
186
- " Which new packages do you want add?" 15 75 6 \
187
- " caffe" " A fast open framework" $( dp_is_enabled " caffe" ) \
188
- " caffe2" " Lightweight, modular, and scalable" $( dp_is_enabled " caffe2" ) \
252
+ " Which new packages do you want add?" 15 75 3 \
189
253
" tensorflow" " Open source machine learning framework" $( dp_is_enabled " tensorflow" ) \
190
- " torch7" " Scientific computing framework" $( dp_is_enabled " torch7" ) \
191
254
" pyTorch" " Tensors & Dynamic neural networks in Python" $( dp_is_enabled " pyTorch" ) \
192
255
" jetson-inference" " Inference net & deep vision with TensorRT" $( dp_is_enabled " jetson-inference" ) 3>&1 1>&2 2>&3 )
193
256
194
- exitstatus=$?
257
+ local exitstatus=$?
195
258
if [ $exitstatus = 0 ]; then
196
259
# Save list of new element to patch
197
260
DP_PATCH_LIST=" $DP_PATCH_LIST_TMP "
198
261
fi
199
-
200
262
}
201
263
202
264
dp_set_install_folder ()
0 commit comments