Skip to content

Commit 0b36195

Browse files
committed
Fix: some issues of installation
1 parent 6f14a44 commit 0b36195

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ source .env/bin/activate
9393
For CPU only:
9494

9595
```bash
96-
pip3 install numpy==1.15.4 Keras==2.2.4 tensorflow==1.12.0
96+
pip install numpy==1.15.4 Keras==2.2.4 tensorflow==1.12.0
9797
```
9898

9999
For GPU:
100100

101101
```bash
102-
pip3 install numpy==1.15.4 Keras==2.2.4 tensorflow-gpu==1.12.0
102+
pip install numpy==1.15.4 Keras==2.2.4 tensorflow-gpu==1.12.0
103103
```
104104

105105
2)The rest of environments:
106106

107107
```bash
108-
pip3 install -r requirements.txt
108+
pip install -r requirements.txt
109109
```
110110

111111
### 4-2. Install Dependencies (Quicker Way)

README_zh.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ source .env/bin/activate
9393
若只在 CPU 环境运行,则:
9494

9595
```bash
96-
pip3 install numpy==1.15.4 Keras==2.2.4 tensorflow==1.12.0
96+
pip install numpy==1.15.4 Keras==2.2.4 tensorflow==1.12.0
9797
```
9898

9999
若在 GPU 环境运行,则:
100100

101101
```bash
102-
pip3 install numpy==1.15.4 Keras==2.2.4 tensorflow-gpu==1.12.0
102+
pip install numpy==1.15.4 Keras==2.2.4 tensorflow-gpu==1.12.0
103103
```
104104

105105
2)剩余部分依赖环境:
106106

107107
```bash
108-
pip3 install -r requirements.txt
108+
pip install -r requirements.txt
109109
```
110110

111111
### 4-2. 安装依赖包(懒人版)

installation.sh

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
1+
#!/bin/bash
2+
13
# 0. Check python and pip3
2-
(python3 -V && pip3 -V) &>/dev/null;
4+
(python3 -V && pip3 -V) &>/dev/null
35
if [[ $? -ne 0 ]]; then
4-
echo "Error: please check whether 'python3' and 'pip3' is valid";
5-
exit 1;
6+
echo "Error: please check whether 'python3' and 'pip3' is valid"
7+
exit 1
68
fi
79

810
# 1. Create virtual environment
9-
conda -V &>/dev/null;
10-
if [[ $? -eq 0 ]]; then
11-
echo "1. Creating conda environment: image_quality";
12-
conda create --name image_quality python=3.6;
13-
source activate image_quality;
11+
conda -V &>/dev/null
12+
is_conda=$?
13+
if [[ $is_conda -eq 0 ]]; then
14+
echo "1. Creating conda environment: image_quality"
15+
conda create -y --name image_quality python=3.6
16+
source activate image_quality
1417
else
1518
echo "1. Creating virtual environment: .env"
1619
python3 -m venv .env
1720
source .env/bin/activate
1821
fi
1922

2023
# 2. Install tensorflow backend
21-
nvidia-smi &>/dev/null;
22-
if [[ $? -eq 0 ]]; then
23-
echo "2. Installing backend: tensorflow-gpu==1.12.0";
24-
pip3 install numpy==1.15.4 Keras==2.2.4 tensorflow-gpu==1.12.0;
24+
nvidia-smi &>/dev/null
25+
is_nvidia=$?
26+
if [[ $is_nvidia -eq 0 ]]; then
27+
echo "2. Installing backend: tensorflow-gpu==1.12.0"
28+
pip install numpy==1.15.4 Keras==2.2.4 tensorflow-gpu==1.12.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
2529
else
26-
echo "2. Installing backend: tensorflow==1.12.0";
27-
pip3 install numpy==1.15.4 Keras==2.2.4 tensorflow==1.12.0;
30+
echo "2. Installing backend: tensorflow==1.12.0"
31+
pip install numpy==1.15.4 Keras==2.2.4 tensorflow==1.12.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
2832
fi
2933

3034
# 3. Install dependencies
31-
echo "3. Installing the rest dependencies";
32-
pip3 install -r requirements.txt;
35+
echo "3. Installing the rest dependencies"
36+
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
3337

3438
# 4. Deactivate
35-
deactivate;
39+
if [[ $is_conda -eq 0 ]]; then
40+
source deactivate
41+
else
42+
deactivate
43+
fi

0 commit comments

Comments
 (0)