1. 下載anaconda
下載鏈接/參考[https://mirror.tuna.tsinghua.edu.cn/help/anaconda/]
2. 檢驗安裝
conda -V
3. 創(chuàng)建虛擬環(huán)境
# 查看當前虛擬環(huán)境
conda env list
# 創(chuàng)建
conda create -n tensorflow python=3.6
# 進入
activate tensorflow
# 退出
deactivate tensorflow
4. 下載tensorflow
activate tensorflow
pip install tensorflow
pip install jupyter #啟動jupyter notebook,目錄時當前啟動目錄
pip install cython
...(相關(guān)包)
5. 校驗tensorflow安裝情況
#demo.py
# -*- encoding -*-
from tensorflow as tf
a = tf.constant(2)
b = tf.constant(3)
c = tf.add(a,b)
with tf.Session() as sess:
? ? print(sess.run(c)) #5
6. 結(jié)合models(object_detection)
# 下載
[https://github.com/tensorflow/models]或[https://pan.baidu.com/s/1a9pBaejcr-OKLiai3htheQ]
# 檢查依賴
[https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md]
# 安裝protobuf[參考:https://blog.csdn.net/zhaoyoulin2016/article/details/80615687]
[https://github.com/protocolbuffers/protobuf]
# cmdr可以在windows中使用linux命令,若遇到gz壓縮文件
將加壓的目錄放到c:\windows目錄下,切換目錄運行以下命令
protoc --python_out=. object_detection/protos/*.proto
# 校驗,就在demo.py加入from object_detection.utils import label_map_util,由于object_detection沒有加入windows-path中,所以需要切換到該目錄下運行(虛擬環(huán)境中)
# 以上沒有報錯,就可以參考該博客文章[https://blog.csdn.net/dy_guox/article/details/79111949],接下來進行你漫長的西天取經(jīng)之旅。