---
# System prepended metadata

title: 大學專題-重啟環境
tags: [大學專題]

---

---
tags: 大學專題
---
# 大學專題-重啟環境
## Posenet 環境_conda boxing

### 安裝軟體&套件:

* GeForce Experience

https://hackmd.io/@Kailyn/SyEWRTTC_

為了跑CUDA應用程式，系統需要有能夠支援CUDA的GPU，以及跟CUDA工具庫相容的驅動程式。

到NVIDIA的Download Drivers:https://www.nvidia.com/zh-tw/geforce/drivers/

#### 從工作管理員(ctrl+alt+delete)查看GPU格式

![](https://i.imgur.com/0JufHXO.png)

#### 驅動成功後，打以下指令出現NVIDIA資訊，代表驅動成功

```
nvidia-smi
```
![](https://i.imgur.com/c1e7H7J.png)


*  Anaconda 3

https://medium.com/ai-for-k12/anaconda-3-%E5%AE%89%E8%A3%9D%E6%95%99%E5%AD%B8%E5%8F%8A%E8%AA%AA%E6%98%8E-3542d8e6a224

#### Anaconda有分成命令式及圖形化的操作方式

* 命令式
> 開啟 Anaconda Prompt

* 圖形化
> 開啟 Anaconda Navigator




*  CUDA 與 CuDNN 安裝

https://qqmanlin.medium.com/cuda-%E8%88%87-cudnn-%E5%AE%89%E8%A3%9D-e982d92162af

#### CUDA有沒有安裝成功，到cmd輸入

```
nvcc -V
```

![](https://i.imgur.com/oPuoUQc.png)


------

### (1)用conda建立及管理python虛擬環境

https://medium.com/python4u/%E7%94%A8conda%E5%BB%BA%E7%AB%8B%E5%8F%8A%E7%AE%A1%E7%90%86python%E8%99%9B%E6%93%AC%E7%92%B0%E5%A2%83-b61fd2a76566

#### 檢查目前版本:

```
conda –V
```
![](https://i.imgur.com/IM4wAB1.png)

#### 目前系統已經安裝幾個虛擬環境:

```
conda env list
```

![](https://i.imgur.com/QmlZ5Tg.png)


#### 建立一個叫做boxing的虛擬環境:

```
conda create --name boxing
```

### 下載 posenet 要的東西: https://github.com/rwightman/posenet-python


#### 切到(啟動) boxing的虛擬環境:

```
activate boxing
```

#### 根據 posenet的文件指示輸入:

##### 所需要安裝的指令如下:

```
conda install tensorflow-gpu scipy pyyaml python=3.6
pip install opencv-python==3.4.5.20
pip install -r requirements.txt
pip install dtw
pip install dtaidistance
```

#### 安裝時遇到的問題:

> ImportError: Could not find 'cudart64_100.dll

https://stackoverflow.com/questions/57528027/importerror-could-not-find-cudart64-100-dll

解決方法:
https://www.joe0.com/2019/10/19/how-resolve-tensorflow-2-0-error-could-not-load-dynamic-library-cudart64_100-dll-dlerror-cudart64_100-dll-not-found/

安裝:
* CUDA Toolkit 10.1 update2 Archive：https://developer.nvidia.com/cuda-10.1-download-archive-update2
* cudart64_100.dll_.zip：https://www.joe0.com/wp-content/uploads/2019/10/cudart64_100.dll_.zip


> Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session'

解決方法:
https://stackoverflow.com/questions/55142951/tensorflow-2-0-attributeerror-module-tensorflow-has-no-attribute-session

------

### 此虛擬環境中安裝了哪些東西:

```
conda list
```

![](https://i.imgur.com/BDcvwtg.png)

![](https://i.imgur.com/W1ygOzZ.png)

![](https://i.imgur.com/mnhBsWK.png)


### Git clone https://github.com/kr1210/Human-Pose-Compare 

#### 切換到 Human-Pose-Compare的資料夾路徑下:
```
cd Human-Pose-Compare
```
![](https://i.imgur.com/T115q2N.png)

### 產生分數與各17個關節點的分數

```
python start_here.py --activity "punch - side" --video "test.mp4"
```

![](https://i.imgur.com/3pblzIr.png)




### [解析 python start_here.py --activity “punch - side” --video “test.mp4”](https://hackmd.io/@Huei/ByENafUj_)






-----
### 參考資料 :

[Human Pose Comparison and Action Scoring using Deep Learning,OpenCV & Python](https://medium.com/analytics-vidhya/human-pose-comparison-and-action-scoring-using-deep-learning-opencv-python-c2bdf0ddecba)

[Windows 10 安裝 顯卡驅動、CUDA Toolkit、cuDNN](https://hackmd.io/@Kailyn/SyEWRTTC_)

[用conda建立及管理python虛擬環境](https://medium.com/python4u/%E7%94%A8conda%E5%BB%BA%E7%AB%8B%E5%8F%8A%E7%AE%A1%E7%90%86python%E8%99%9B%E6%93%AC%E7%92%B0%E5%A2%83-b61fd2a76566
)

### 參考文章 : 

[Human Pose Comparison and Action Scoring using Deep Learning,OpenCV & Python
](https://medium.com/analytics-vidhya/human-pose-comparison-and-action-scoring-using-deep-learning-opencv-python-c2bdf0ddecba)