Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a6af3612
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a6af3612
编写于
1月 30, 2019
作者:
J
JiabinYang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fast_install_1.3' of
https://github.com/JiabinYang/Paddle
into fast_install_1.3
上级
ff85734e
125f36b6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
351 addition
and
289 deletion
+351
-289
paddle/scripts/fast_install.sh
paddle/scripts/fast_install.sh
+351
-289
未找到文件。
paddle/scripts/fast_install.sh
浏览文件 @
a6af3612
...
@@ -3,13 +3,20 @@
...
@@ -3,13 +3,20 @@
path
=
'http://paddlepaddle.org/download?url='
path
=
'http://paddlepaddle.org/download?url='
#release_version=`curl -s https://pypi.org/project/paddlepaddle/|grep -E "/project/paddlepaddle/"|grep "release"|awk -F '/' '{print $(NF-1)}'|head -1`
#release_version=`curl -s https://pypi.org/project/paddlepaddle/|grep -E "/project/paddlepaddle/"|grep "release"|awk -F '/' '{print $(NF-1)}'|head -1`
release_version
=
1.2.0
release_version
=
1.2.0
python_list
=(
"27"
"35"
"36"
"37"
)
function
use_cpu
(){
function
use_cpu
(){
while
true
while
true
do
do
read
-p
"是否安装CPU版本的PaddlePaddle?(y/n), 或使用ctrl + c退出: "
cpu_option
read
-p
"是否安装CPU版本的PaddlePaddle?(y/n), 或使用ctrl + c退出: "
cpu_option
cpu_option
=
`
echo
$cpu_option
|
tr
'A-Z'
'a-z'
`
cpu_option
=
`
echo
$cpu_option
|
tr
'A-Z'
'a-z'
`
if
[
"
$cpu_option
"
==
""
||
"
$cpu_option
"
==
"n"
]
;
then
if
[
[
"
$cpu_option
"
==
""
||
"
$cpu_option
"
==
"n"
]
]
;
then
echo
"退出安装中...."
echo
"退出安装中...."
exit
exit
else
else
...
@@ -20,7 +27,7 @@ function use_cpu(){
...
@@ -20,7 +27,7 @@ function use_cpu(){
done
done
}
}
function
check
_p
ython2
(){
function
check
MacP
ython2
(){
while
true
while
true
do
do
read
-p
"未发现除MacOS自带的python外的可用python,
read
-p
"未发现除MacOS自带的python外的可用python,
...
@@ -57,7 +64,7 @@ function check_python2(){
...
@@ -57,7 +64,7 @@ function check_python2(){
done
done
}
}
function
check
_p
ython3
(){
function
check
MacP
ython3
(){
while
true
while
true
do
do
read
-p
"未发现可用的python3,
read
-p
"未发现可用的python3,
...
@@ -94,8 +101,322 @@ function check_python3(){
...
@@ -94,8 +101,322 @@ function check_python3(){
done
done
}
}
function
checkLinuxCUDNN
(){
while
true
do
version_file
=
'/usr/local/cuda/include/cudnn.h'
if
[
-f
"
$version_file
"
]
;
then
CUDNN
=
`
cat
$version_file
|
grep
CUDNN_MAJOR |awk
'NR==1{print $NF}'
`
fi
if
[
"
$CUDNN
"
==
""
]
;
then
version_file
=
`
sudo
find /usr
-name
"cudnn.h"
|head
-1
`
if
[
"
$version_file
"
!=
""
]
;
then
CUDNN
=
`
cat
${
version_file
}
|
grep
CUDNN_MAJOR
-A
2|awk
'NR==1{print $NF}'
`
else
echo
"未找到cuda/include/cudnn.h文件"
while
true
do
read
-p
"请提供cudnn.h的路径:"
cudnn_version
if
[
"
$cudnn_version
"
==
""
]
||
[
!
-f
"
$cudnn_version
"
]
;
then
read
-p
"未找到cuDNN,只能安装cpu版本的PaddlePaddle,是否安装(y/n), 或使用ctrl + c退出:"
cpu_option
cpu_option
=
`
echo
$cpu_option
|
tr
'A-Z'
'a-z'
`
if
[
"
$cpu_option
"
==
"y"
-o
"
$cpu_option
"
==
""
]
;
then
GPU
=
'cpu'
break
else
echo
"重新输入..."
fi
else
CUDNN
=
`
cat
$cudnn_version
|
grep
CUDNN_MAJOR |awk
'NR==1{print $NF}'
`
echo
"您的CUDNN版本是
${
CUDNN
}
"
break
fi
done
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
fi
if
[
"
$CUDA
"
==
"9"
-a
"
$CUDNN
"
!=
"7"
]
;
then
echo
CUDA9目前只支持CUDNN7
use_cpu
()
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
if
[
"
$CUDNN
"
==
5
]
||
[
"
$CUDNN
"
==
7
]
;
then
echo
"您的CUDNN版本是CUDNN
$CUDNN
"
break
else
echo
"你的CUDNN
${
CUDNN
}
版本不支持,目前支持CUDNN5/7"
use_cpu
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
done
}
function
checkLinuxCUDA
(){
while
true
do
CUDA
=
`
echo
${
CUDA_VERSION
}
|awk
-F
"[ .]"
'{print $1}'
`
if
[
"
$CUDA
"
==
""
]
;
then
if
[
-f
"/usr/local/cuda/version.txt"
]
;
then
CUDA
=
`
cat
/usr/local/cuda/version.txt |
grep
'CUDA Version'
|awk
-F
'[ .]'
'{print $3}'
`
tmp_cuda
=
$CUDA
fi
if
[
-f
"/usr/local/cuda8/version.txt"
]
;
then
CUDA
=
`
cat
/usr/local/cuda8/version.txt |
grep
'CUDA Version'
|awk
-F
'[ .]'
'{print $3}'
`
tmp_cuda8
=
$CUDA
fi
if
[
-f
"/usr/local/cuda9/version.txt"
]
;
then
CUDA
=
`
cat
/usr/local/cuda9/version.txt |
grep
'CUDA Version'
|awk
-F
'[ .]'
'{print $3}'
`
tmp_cuda9
=
$CUDA
fi
fi
if
[
"
$tmp_cuda
"
!=
""
]
;
then
echo
"找到CUDA
$tmp_cuda
"
fi
if
[
"
$tmp_cudai8
"
!=
""
]
;
then
echo
"找到CUDA
$tmp_cuda8
"
fi
if
[
"
$tmp_cuda9
"
!=
""
]
;
then
echo
"找到CUDA
$tmp_cuda9
"
fi
if
[
"
$CUDA
"
==
""
]
;
then
echo
"没有找到cuda/version.txt文件"
while
true
do
read
-p
"请提供cuda version.txt的路径:"
cuda_version
if
[
"
$cuda_version
"
==
""
||
!
-f
"
$cuda_version
"
]
;
then
read
-p
"未找到CUDA,只能安装cpu版本的PaddlePaddle,是否安装(y/n), 或使用ctrl + c退出"
cpu_option
cpu_option
=
`
echo
$cpu_option
|
tr
'A-Z'
'a-z'
`
if
[
"
$cpu_option
"
==
"y"
||
"
$cpu_option
"
==
""
]
;
then
GPU
=
'cpu'
break
else
echo
"重新输入..."
fi
else
CUDA
=
`
cat
$cuda_version
|
grep
'CUDA Version'
|awk
-F
'[ .]'
'{print $3}'
`
if
[
"
$CUDA
"
==
""
]
;
then
echo
"未找到CUDA,重新输入..."
else
break
fi
fi
done
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
if
[
"
$CUDA
"
==
"8"
]
||
[
"
$CUDA
"
==
"9"
]
;
then
echo
"您的CUDA版本是
${
CUDA
}
"
break
else
echo
"你的CUDA
${
CUDA
}
版本不支持,目前支持CUDA8/9"
use_cpu
fi
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
done
}
function
checkLinuxMathLibrary
(){
while
true
do
if
[
"
$AVX
"
==
""
]
;
then
math
=
'mkl'
break
elif
[
"
$GPU
"
==
"gpu"
]
;
then
math
=
'mkl'
break
else
read
-p
"请输入您想使用哪个数学库?OpenBlas或MKL?:
输入1:openblas
输入2:mkl
请选择:"
math
if
[
"
$math
"
==
""
]
;
then
math
=
"mkl"
echo
"为您安装mkl"
break
fi
if
[
"
$math
"
==
"1"
]
;
then
math
=
openblas
echo
"为您安装openblas"
break
elif
[
"
$math
"
==
"2"
]
;
then
math
=
mkl
echo
"为您安装mkl"
break
fi
echo
"输入错误,请再次输入"
fi
done
}
function
checkLinuxPaddleVersion
(){
while
true
do
read
-p
"请选择Paddle版本:
输入1:develop
输入2:release-
${
release_version
}
请选择:"
paddle_version
if
[
"
$paddle_version
"
==
""
]
;
then
paddle_version
=
"release-
${
release_version
}
"
echo
"为您安装release-
${
release_version
}
"
break
fi
if
[
"
$paddle_version
"
==
"1"
]
;
then
echo
"为您安装develop"
break
elif
[
"
$paddle_version
"
==
"2"
]
;
then
echo
"为您安装release-
${
release_version
}
"
break
fi
echo
"输入错误,请再次输入"
done
}
function
checkLinuxPip
(){
while
true
do
echo
"请输入您要使用的pip目录(您可以使用which pip来查看):"
read
-p
""
pip_path
if
[
"
$pip_path
"
==
""
-o
!
-f
"
$pip_path
"
]
;
then
echo
"pip不存在,请重新输入"
continue
fi
python_version
=
`
$pip_path
--version
|awk
-F
"[ |)]"
'{print $6}'
|sed
's#\.##g'
`
if
[
"
$python_version
"
==
"27"
]
;
then
uncode
=
`
python
-c
"import pip._internal;print(pip._internal.pep425tags.get_supported())"
|grep
"cp27mu"
`
if
[[
"
$uncode
"
==
""
]]
;
then
uncode
=
else
uncode
=
u
fi
fi
if
[
"
$python_version
"
==
""
]
;
then
echo
"pip不存在,请重新输入"
else
version_list
=
`
echo
"
${
python_list
[@]
}
"
|
grep
"
$python_version
"
`
if
[
"
$version_list
"
!=
""
]
;
then
echo
"找到python
${
python_version
}
版本"
break
else
echo
"找不到可用的 pip, 我们只支持Python27/35/36/37及其对应的pip, 请重新输入, 或使用ctrl + c退出 "
fi
fi
done
}
function
checkLinuxAVX
(){
while
true
do
if
[[
"
$AVX
"
!=
""
]]
;
then
AVX
=
"avx"
break
else
if
[
"
$CUDA
"
==
"8"
-a
"
$CUDNN
"
==
"7"
]
||
[
"
$GPU
"
==
"cpu"
]
;
then
AVX
=
"noavx"
break
else
echo
"我们仅支持纯CPU或GPU with CUDA 8 cuDNN 7 下noavx版本的安装,请使用cat /proc/cpuinfo | grep avx检查您计算机的avx指令集支持情况"
break
fi
fi
done
}
function
PipLinuxInstall
(){
wheel_cpu_release
=
"http://paddle-wheel.bj.bcebos.com/
${
release_version
}
-
${
GPU
}
-
${
AVX
}
-
${
math
}
/paddlepaddle-
${
release_version
}
-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
wheel_gpu_release
=
"http://paddle-wheel.bj.bcebos.com/
${
release_version
}
-gpu-cuda
${
CUDA
}
-cudnn
${
CUDNN
}
-
${
AVX
}
-
${
math
}
/paddlepaddle_gpu-
${
release_version
}
.post
${
CUDA
}${
CUDNN
}
-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
wheel_gpu_release_noavx
=
"http://paddle-wheel.bj.bcebos.com/
${
release_version
}
-gpu-cuda
${
CUDA
}
-cudnn
${
CUDNN
}
-
${
AVX
}
-
${
math
}
/paddlepaddle_gpu-
${
release_version
}
-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
wheel_cpu_develop
=
"http://paddle-wheel.bj.bcebos.com/latest-cpu-
${
AVX
}
-
${
math
}
/paddlepaddle-latest-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
wheel_gpu_develop
=
"http://paddle-wheel.bj.bcebos.com/latest-gpu-cuda
${
CUDA
}
-cudnn
${
CUDNN
}
-
${
AVX
}
-
${
math
}
/paddlepaddle_gpu-latest-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
if
[[
"
$paddle_version
"
==
"2"
]]
;
then
if
[[
"
$GPU
"
==
"gpu"
]]
;
then
if
[[
${
AVX
}
==
"avx"
]]
;
then
rm
-rf
`
echo
$wheel_gpu_release
|awk
-F
'/'
'{print $NF}'
`
wget
-q
$wheel_gpu_release
if
[
"
$?
"
!=
"0"
]
;
then
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_gpu_release
else
echo
paddlepaddle whl包下载失败
exit
1
fi
else
rm
-rf
`
echo
$wheel_gpu_release_novax
|awk
-F
'/'
'{print $NF}'
`
wget
-q
$wheel_gpu_release_novax
if
[
"
$?
"
!=
"0"
]
;
then
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_gpu_release_noavx
else
echo
paddlepaddle whl包下载失败
exit
1
fi
fi
else
rm
-rf
`
echo
$wheel_cpu_release
|awk
-F
'/'
'{print $NF}'
`
wget
-q
$wheel_cpu_release
if
[
"
$?
"
!=
"0"
]
;
then
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_cpu_release
else
echo
paddlepaddle whl包下载失败
exit
1
fi
fi
else
if
[[
"
$GPU
"
==
"gpu"
]]
;
then
rm
-rf
`
echo
$wheel_gpu_develop
|awk
-F
'/'
'{print $NF}'
`
wget
-q
$wheel_gpu_develop
if
[
"
$?
"
!=
"0"
]
;
then
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_gpu_develop
else
echo
paddlepaddle whl包下载失败
exit
1
fi
else
rm
-rf
`
echo
$wheel_cpu_develop
|awk
-F
'/'
'{print $NF}'
`
wget
-q
$wheel_cpu_develop
if
[
"
$?
"
!=
"0"
]
;
then
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_cpu_develop
else
echo
paddlepaddle whl包下载失败
exit
1
fi
fi
fi
}
function
checkLinuxGPU
(){
AVX
=
`
cat
/proc/cpuinfo |grep avx|tail
-1
|grep avx
`
which nvidia-smi
>
/dev/null 2>&1
if
[
"
$?
"
!=
"0"
]
;
then
GPU
=
'cpu'
echo
"您使用的是不包含支持的GPU的机器"
else
GPU
=
'gpu'
echo
"您使用的是包含我们支持的GPU机器"
fi
if
[
"
$GPU
"
==
'gpu'
]
;
then
checkLinuxCUDA
checkLinuxCUDNN
fi
}
function
linux
(){
function
linux
(){
gpu_list
=(
"GeForce 410M"
gpu_list
=(
"GeForce 410M"
"GeForce 610M"
"GeForce 610M"
"GeForce 705M"
"GeForce 705M"
"GeForce 710M"
"GeForce 710M"
...
@@ -291,281 +612,14 @@ gpu_list=("GeForce 410M"
...
@@ -291,281 +612,14 @@ gpu_list=("GeForce 410M"
"Tesla P4"
"Tesla P4"
"Tesla P40"
"Tesla P40"
"Tesla V100"
)
"Tesla V100"
)
checkLinuxGPU
AVX
=
`
cat
/proc/cpuinfo |grep avx|tail
-1
|grep avx
`
checkLinuxMathLibrary
which_gpu
=
`
lspci |grep
-i
nvidia
`
checkLinuxPaddleVersion
if
[
"
$which_gpu
"
==
""
]
;
then
checkLinuxPip
GPU
=
'cpu'
checkLinuxAVX
echo
"您使用的是不包含支持的GPU的机器"
PipLinuxInstall
else
GPU
=
'gpu'
echo
"您使用的是包含我们支持的GPU机器"
fi
if
[
"
$GPU
"
==
'gpu'
]
;
then
while
true
do
gpu_model
=
`
nvidia-smi |awk
'NR==8{print $3,$4}'
|sed
's#m$##g'
`
Flag
=
False
for
i
in
"
${
gpu_list
[@]
}
"
do
if
[
"
$gpu_model
"
==
"
$i
"
]
;
then
Flag
=
True
fi
done
if
[
"
$Flag
"
!=
"True"
]
;
then
echo
"目前我们还不支持您使用的GPU型号"
use_cpu
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
CUDA
=
`
echo
${
CUDA_VERSION
}
|awk
-F
"[ .]"
'{print $1}'
`
if
[
"
$CUDA
"
==
""
]
;
then
if
[
-f
"/usr/local/cuda/version.txt"
]
;
then
CUDA
=
`
cat
/usr/local/cuda/version.txt |
grep
'CUDA Version'
|awk
-F
'[ .]'
'{print $3}'
`
tmp_cuda
=
$CUDA
fi
if
[
-f
"/usr/local/cuda8/version.txt"
]
;
then
CUDA
=
`
cat
/usr/local/cuda8/version.txt |
grep
'CUDA Version'
|awk
-F
'[ .]'
'{print $3}'
`
tmp_cuda8
=
$CUDA
fi
if
[
-f
"/usr/local/cuda9/version.txt"
]
;
then
CUDA
=
`
cat
/usr/local/cuda9/version.txt |
grep
'CUDA Version'
|awk
-F
'[ .]'
'{print $3}'
`
tmp_cuda9
=
$CUDA
fi
fi
if
[
"
$tmp_cuda
"
!=
""
]
;
then
echo
"找到CUDA
$tmp_cuda
"
fi
if
[
"
$tmp_cudai8
"
!=
""
]
;
then
echo
"找到CUDA
$tmp_cuda8
"
fi
if
[
"
$tmp_cuda9
"
!=
""
]
;
then
echo
"找到CUDA
$tmp_cuda9
"
fi
if
[
"
$CUDA
"
==
""
]
;
then
echo
"没有找到cuda/version.txt文件"
while
true
do
read
-p
"请提供cuda version.txt的路径:"
cuda_version
if
[
"
$cuda_version
"
==
""
||
!
-f
"
$cuda_version
"
]
;
then
read
-p
"未找到CUDA,只能安装cpu版本的PaddlePaddle,是否安装(y/n), 或使用ctrl + c退出"
cpu_option
cpu_option
=
`
echo
$cpu_option
|
tr
'A-Z'
'a-z'
`
if
[
"
$cpu_option
"
==
"y"
||
"
$cpu_option
"
==
""
]
;
then
GPU
=
'cpu'
break
else
echo
"重新输入..."
fi
else
CUDA
=
`
cat
$cuda_version
|
grep
'CUDA Version'
|awk
-F
'[ .]'
'{print $3}'
`
if
[
"
$CUDA
"
==
""
]
;
then
echo
"未找到CUDA,重新输入..."
else
break
fi
fi
done
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
if
[
"
$CUDA
"
==
"8"
]
||
[
"
$CUDA
"
==
"9"
]
;
then
echo
"您的CUDA版本是
${
CUDA
}
"
else
echo
"你的CUDA
${
CUDA
}
版本不支持,目前支持CUDA8/9"
use_cpu
fi
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
version_file
=
'/usr/local/cuda/include/cudnn.h'
if
[
-f
"
$version_file
"
]
;
then
CUDNN
=
`
cat
$version_file
|
grep
CUDNN_MAJOR |awk
'NR==1{print $NF}'
`
fi
if
[
"
$CUDNN
"
==
""
]
;
then
version_file
=
`
sudo
find /usr
-name
"cudnn.h"
|head
-1
`
if
[
"
$version_file
"
!=
""
]
;
then
CUDNN
=
`
cat
${
version_file
}
|
grep
CUDNN_MAJOR
-A
2|awk
'NR==1{print $NF}'
`
else
echo
"未找到cuda/include/cudnn.h文件"
while
true
do
read
-p
"请提供cudnn.h的路径:"
cudnn_version
if
[
"
$cudnn_version
"
==
""
]
||
[
!
-f
"
$cudnn_version
"
]
;
then
read
-p
"未找到cuDNN,只能安装cpu版本的PaddlePaddle,是否安装(y/n), 或使用ctrl + c退出:"
cpu_option
cpu_option
=
`
echo
$cpu_option
|
tr
'A-Z'
'a-z'
`
if
[
"
$cpu_option
"
==
"y"
-o
"
$cpu_option
"
==
""
]
;
then
GPU
=
'cpu'
break
else
echo
"重新输入..."
fi
else
CUDNN
=
`
cat
$cudnn_version
|
grep
CUDNN_MAJOR |awk
'NR==1{print $NF}'
`
echo
"您的CUDNN版本是
${
CUDNN
}
"
break
fi
done
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
fi
if
[
"
$CUDA
"
==
"9"
-a
"
$CUDNN
"
!=
"7"
]
;
then
echo
CUDA9目前只支持CUDNN7
use_cpu
()
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
if
[
"
$CUDNN
"
==
5
]
||
[
"
$CUDNN
"
==
7
]
;
then
echo
"您的CUDNN版本是CUDNN
$CUDNN
"
break
else
echo
"你的CUDNN
${
CUDNN
}
版本不支持,目前支持CUDNN5/7"
use_cpu
if
[
"
$GPU
"
==
"cpu"
]
;
then
break
fi
fi
done
fi
while
true
do
if
[
"
$AVX
"
==
""
]
;
then
math
=
'mkl'
break
elif
[
"
$GPU
"
==
"gpu"
]
;
then
math
=
'mkl'
break
else
read
-p
"请输入您想使用哪个数学库?OpenBlas或MKL?:
输入1:openblas
输入2:mkl
请选择:"
math
if
[
"
$math
"
==
""
]
;
then
math
=
"mkl"
echo
"为您安装mkl"
break
fi
if
[
"
$math
"
==
"1"
]
;
then
math
=
openblas
echo
"为您安装openblas"
break
elif
[
"
$math
"
==
"2"
]
;
then
math
=
mkl
echo
"为您安装mkl"
break
fi
echo
"输入错误,请再次输入"
fi
done
while
true
do
read
-p
"请选择Paddle版本:
输入1:develop
输入2:release-
${
release_version
}
请选择:"
paddle_version
if
[
"
$paddle_version
"
==
""
]
;
then
paddle_version
=
"release-
${
release_version
}
"
echo
"为您安装release-
${
release_version
}
"
break
fi
if
[
"
$paddle_version
"
==
"1"
]
;
then
echo
"为您安装develop"
break
elif
[
"
$paddle_version
"
==
"2"
]
;
then
echo
"为您安装release-
${
release_version
}
"
break
fi
echo
"输入错误,请再次输入"
done
while
true
do
echo
"请输入您要使用的pip目录(您可以使用which pip来查看):"
read
-p
""
pip_path
if
[
"
$pip_path
"
==
""
-o
!
-f
"
$pip_path
"
]
;
then
echo
"pip不存在,请重新输入"
continue
fi
python_version
=
`
$pip_path
--version
|awk
-F
"[ |)]"
'{print $6}'
|sed
's#\.##g'
`
if
[
"
$python_version
"
==
"27"
]
;
then
uncode
=
`
python
-c
"import pip._internal;print(pip._internal.pep425tags.get_supported())"
|grep
"cp27mu"
`
if
[[
"
$uncode
"
==
""
]]
;
then
uncode
=
else
uncode
=
u
fi
fi
echo
$python_version
if
[
"
$python_version
"
==
"27"
-o
"
$python_version
"
==
"35"
-o
"
$python_version
"
==
"36"
-o
"
$python_version
"
==
"37"
]
;
then
echo
"找到python
${
python_version
}
版本"
break
else
echo
"找不到可用的 pip, 我们只支持Python27/35/36/37及其对应的pip, 请重新输入, 或使用ctrl + c退出 "
fi
done
if
[[
"
$AVX
"
!=
""
]]
;
then
AVX
=
avx
else
if
[
"
$CUDA
"
==
"8"
-a
"
$CUDNN
"
==
"7"
]
||
[
"
$GPU
"
==
"cpu"
]
;
then
AVX
=
navx
else
echo
"我们仅支持纯CPU或GPU with CUDA 8 cuDNN 7 下navx版本的安装,请使用cat /proc/cpuinfo | grep avx检查您计算机的avx指令集支持情况"
exit
fi
fi
wheel_cpu_release
=
"http://paddle-wheel.bj.bcebos.com/
${
release_version
}
-
${
GPU
}
-
${
AVX
}
-
${
math
}
/paddlepaddle-
${
release_version
}
-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
wheel_gpu_release
=
"http://paddle-wheel.bj.bcebos.com/
${
release_version
}
-gpu-cuda
${
CUDA
}
-cudnn
${
CUDNN
}
-
${
AVX
}
-
${
math
}
/paddlepaddle_gpu-
${
release_version
}
.post
${
CUDA
}${
CUDNN
}
-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
wheel_gpu_release_navx
=
"http://paddle-wheel.bj.bcebos.com/
${
release_version
}
-gpu-cuda
${
CUDA
}
-cudnn
${
CUDNN
}
-
${
AVX
}
-
${
math
}
/paddlepaddle_gpu-
${
release_version
}
-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
wheel_cpu_develop
=
"http://paddle-wheel.bj.bcebos.com/latest-cpu-
${
AVX
}
-
${
math
}
/paddlepaddle-latest-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
wheel_gpu_develop
=
"http://paddle-wheel.bj.bcebos.com/latest-gpu-cuda
${
CUDA
}
-cudnn
${
CUDNN
}
-
${
AVX
}
-
${
math
}
/paddlepaddle_gpu-latest-cp
${
python_version
}
-cp
${
python_version
}
m
${
uncode
}
-linux_x86_64.whl"
if
[[
"
$paddle_version
"
==
"2"
]]
;
then
if
[[
"
$GPU
"
==
"gpu"
]]
;
then
if
[[
${
AVX
}
==
"avx"
]]
;
then
rm
-rf
`
echo
$wheel_cpu_develop
|awk
-F
'/'
'{print $NF}'
`
wget
$wheel_cpu_develop
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_gpu_release
else
rm
-rf
`
echo
$wheel_cpu_release_nvax
|awk
-F
'/'
'{print $NF}'
`
wget
$wheel_cpu_release_nvax
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_gpu_release_navx
fi
else
rm
-rf
`
echo
$wheel_cpu_develop
|awk
-F
'/'
'{print $NF}'
`
wget
$wheel_cpu_develop
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_cpu_release
fi
else
if
[[
"
$GPU
"
==
"gpu"
]]
;
then
rm
-rf
`
echo
$wheel_gpu_develop
|awk
-F
'/'
'{print $NF}'
`
wget
$wheel_gpu_develop
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_gpu_develop
else
rm
-rf
`
echo
$wheel_cpu_develop
|awk
-F
'/'
'{print $NF}'
`
wget
$wheel_cpu_develop
$pip_path
install
--user
-i
https://mirrors.aliyun.com/pypi/simple
--trusted-host
=
mirrors.aliyun.com
$wheel_cpu_develop
fi
fi
}
}
function
checkMacPaddleVersion
(){
function
checkMacPaddleVersion
(){
while
true
while
true
do
do
...
@@ -605,7 +659,7 @@ function checkMacPythonVersion(){
...
@@ -605,7 +659,7 @@ function checkMacPythonVersion(){
python_version
=
""
python_version
=
""
fi
fi
if
[
"
$python_root
"
==
""
]||[
"
$python_root
"
==
"/usr/bin/python"
-a
"
$python_version
"
==
"Python 2.7.10"
]||[
"
$python_root
"
==
"/usr/bin/python2.7"
-a
"
$python_version
"
==
"Python 2.7.10"
]
;
then
if
[
"
$python_root
"
==
""
]||[
"
$python_root
"
==
"/usr/bin/python"
-a
"
$python_version
"
==
"Python 2.7.10"
]||[
"
$python_root
"
==
"/usr/bin/python2.7"
-a
"
$python_version
"
==
"Python 2.7.10"
]
;
then
check
_p
ython2
check
MacP
ython2
fi
fi
while
true
while
true
do
do
...
@@ -615,7 +669,7 @@ function checkMacPythonVersion(){
...
@@ -615,7 +669,7 @@ function checkMacPythonVersion(){
break
break
elif
[
"
$use_python
"
==
"n"
]
;
then
elif
[
"
$use_python
"
==
"n"
]
;
then
python_root
=
""
python_root
=
""
check
_p
ython2
check
MacP
ython2
break
break
else
else
echo
"输入错误,请重新输入"
echo
"输入错误,请重新输入"
...
@@ -631,7 +685,7 @@ function checkMacPythonVersion(){
...
@@ -631,7 +685,7 @@ function checkMacPythonVersion(){
python_version
=
""
python_version
=
""
fi
fi
if
[
"
$python_root
"
==
""
]||[
"
$python_root
"
==
"/usr/bin/python"
-a
"
$python_version
"
==
"Python 2.7.10"
]
;
then
if
[
"
$python_root
"
==
""
]||[
"
$python_root
"
==
"/usr/bin/python"
-a
"
$python_version
"
==
"Python 2.7.10"
]
;
then
check
_p
ython3
check
MacP
ython3
fi
fi
while
true
while
true
do
do
...
@@ -640,7 +694,7 @@ function checkMacPythonVersion(){
...
@@ -640,7 +694,7 @@ function checkMacPythonVersion(){
if
[
"
$use_python
"
==
"y"
]||[
"
$use_python
"
==
""
]
;
then
if
[
"
$use_python
"
==
"y"
]||[
"
$use_python
"
==
""
]
;
then
break
break
elif
[
"
$use_python
"
==
"n"
]
;
then
elif
[
"
$use_python
"
==
"n"
]
;
then
check
_p
ython3
check
MacP
ython3
break
break
else
else
echo
"输入错误,请重新输入"
echo
"输入错误,请重新输入"
...
@@ -656,15 +710,17 @@ function checkMacPythonVersion(){
...
@@ -656,15 +710,17 @@ function checkMacPythonVersion(){
if
[[
$python_brief_version
==
"27"
]]
;
then
if
[[
$python_brief_version
==
"27"
]]
;
then
uncode
=
`
python
-c
"import pip._internal;print(pip._internal.pep425tags.get_supported())"
|grep
"cp27"
`
uncode
=
`
python
-c
"import pip._internal;print(pip._internal.pep425tags.get_supported())"
|grep
"cp27"
`
if
[[
$uncode
==
""
]]
;
then
if
[[
$uncode
==
""
]]
;
then
uncode
=
mu
uncode
=
"mu"
else
else
uncode
=
m
uncode
=
"m"
fi
fi
fi
fi
if
[[
"
$python_brief_version
"
==
"27"
||
"
$python_brief_version
"
==
"35"
||
"
$python_brief_version
"
==
"36"
||
"
$python_brief_version
"
==
"37"
]]
;
then
echo
${
python_list
[@]
}
break
version_list
=
`
echo
"
${
python_list
[@]
}
"
|
grep
"
$python_brief_version
"
`
else
if
[
"
$version_list
"
!=
""
]
;
then
echo
"未发现可用的pip或pip3/pip3.x, 我们只支持Python2.7/3.5/3.6/3.7及其对应的pip, 请重新输入, 或使用ctrl + c退出"
break
else
echo
"未发现可用的pip或pip3/pip3.x, 我们只支持Python2.7/3.5/3.6/3.7及其对应的pip, 请重新输入, 或使用ctrl + c退出"
fi
fi
else
else
echo
"输入错误,请重新输入"
echo
"输入错误,请重新输入"
...
@@ -674,7 +730,7 @@ function checkMacPythonVersion(){
...
@@ -674,7 +730,7 @@ function checkMacPythonVersion(){
function
checkMacAVX
(){
function
checkMacAVX
(){
if
[[
$AVX
!=
""
]]
;
then
if
[[
$AVX
!=
""
]]
;
then
AVX
=
avx
AVX
=
"avx"
else
else
echo
"您的Mac不支持AVX指令集,目前不能安装PaddlePaddle"
echo
"您的Mac不支持AVX指令集,目前不能安装PaddlePaddle"
fi
fi
...
@@ -717,6 +773,7 @@ function macos() {
...
@@ -717,6 +773,7 @@ function macos() {
echo
""
echo
""
echo
"=========================================================================================="
echo
"=========================================================================================="
echo
""
echo
""
exit
1
fi
fi
else
else
wget
${
path
}
$wheel_cpu_release
-O
$whl_cpu_release
wget
${
path
}
$wheel_cpu_release
-O
$whl_cpu_release
...
@@ -732,6 +789,7 @@ function macos() {
...
@@ -732,6 +789,7 @@ function macos() {
echo
""
echo
""
echo
"=========================================================================================="
echo
"=========================================================================================="
echo
""
echo
""
exit
1
fi
fi
else
else
rm
$whl_cpu_release
rm
$whl_cpu_release
...
@@ -739,6 +797,7 @@ function macos() {
...
@@ -739,6 +797,7 @@ function macos() {
echo
""
echo
""
echo
"=========================================================================================="
echo
"=========================================================================================="
echo
""
echo
""
exit
1
fi
fi
fi
fi
else
else
...
@@ -753,6 +812,7 @@ function macos() {
...
@@ -753,6 +812,7 @@ function macos() {
echo
""
echo
""
echo
"=========================================================================================="
echo
"=========================================================================================="
echo
""
echo
""
exit
1
fi
fi
else
else
wget
${
path
}
$whl_cpu_develop
-O
$whl_cpu_develop
wget
${
path
}
$whl_cpu_develop
-O
$whl_cpu_develop
...
@@ -768,6 +828,7 @@ function macos() {
...
@@ -768,6 +828,7 @@ function macos() {
echo
""
echo
""
echo
"=========================================================================================="
echo
"=========================================================================================="
echo
""
echo
""
exit
1
fi
fi
else
else
rm
$whl_cpu_develop
rm
$whl_cpu_develop
...
@@ -775,6 +836,7 @@ function macos() {
...
@@ -775,6 +836,7 @@ function macos() {
echo
""
echo
""
echo
"=========================================================================================="
echo
"=========================================================================================="
echo
""
echo
""
exit
1
fi
fi
fi
fi
fi
fi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录