tensorflow命令行安装失败_2019-1 强化学习入坑记之ancanda安装
入門RL強化學習,首先要裝Tensorflow環境,用ananconda最佳,以此記錄我的安裝過程
計劃:
1. anaconda安裝
下載anaconda(官網下載)
官網速度很慢,最好用迅雷下載,可能因為時區問題,通常早晨快點:Anaconda Python/R Distribution - Anaconda
Anaconda installer archive?repo.anaconda.com清華鏡像:Anaconda installer archive清華鏡像:
Tsinghua Open Source Mirror?mirrors.tuna.tsinghua.edu.cn在windows或者linux下分別選擇對應的版本,安裝。
之前看資訊,python2.7后面很多軟件都不再支持了,所以果斷選擇3.x版本,目前最新的是ananconda對應的是python3.7。考慮到適合python3.6的軟件包更多,所以嘗試建3.6環境。
參考如下鏈接,中的anaconda與python的版本號對應關系,選擇python3.6X對應的anaconda3-5.2.0
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Windows-x86_64.exe?mirrors.tuna.tsinghua.edu.cnhttps://blog.csdn.net/yuejisuo1948/article/details/81043823
2. python3.6 環境設置
后續要使用pytorch,為避免沖突,分別建tensorflow和pytorch環境:
打開anaconda navigator的environment,點create按鈕,創建tensorflow,根據安裝的anaconda來默認python版本,默認python3.6.。要拷貝若干G文件,要等待一會。
選擇合適的tensorflow版本,選擇tf1.12, 清華鏡像上tf等都太老了。
tensorflow?pypi.orghttps://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
4-05總是報失敗,改用命令行方式,進入 conda prompt
conda create -n tensorflow python=3.6.5
激活新建環境:conda activate tensorflow
再到anaconda navigator 在tensorflow下查找ipython,安裝ipython和notebook。
還是報錯,
退回到base環境,直接在prompt下安裝tf1.12:
pip install F:TDDownloadtensorflow-1.12.0-cp36-cp36m-win_amd64.whl
看顯示安裝成功。驗證測試
import tensorflow as tf hello = tf.constant('Hello,TensorFlow!') sess = tf.Session() print(sess.run(hello)) #輸出:b'Hello,TensorFlow!'下載Keras包安裝2.2.4版本。直接安裝
(base) C:Userslw>pip install F:TDDownloadKeras-2.2.4-py2.py3-none-any.whl
import keras
測試成功。
此時在anaconda navigator中還是看不到tensorflow。雖然不知道原因是什么,但后續只能在命令行方式安裝包了。
第五部 gym安裝
到git上下載openai/gym,解壓縮到本地,win10操作系統。在anaconda prompt命令行方式下:
cd gym-master pip install -e .(base) F:cmp_datarlgymgym-master>pip install -e . Obtaining file:///F:/cmp_data/rlgym/gym-master Requirement already satisfied: scipy in d:anaconda3_520libsite-packages (from gym==0.12.1) (1.1.0) Requirement already satisfied: numpy>=1.10.4 in d:anaconda3_520libsite-packages (from gym==0.12.1) (1.14.3) Requirement already satisfied: requests>=2.0 in d:anaconda3_520libsite-packages (from gym==0.12.1) (2.18.4) Requirement already satisfied: six in d:anaconda3_520libsite-packages (from gym==0.12.1) (1.11.0) Collecting pyglet>=1.2.0 (from gym==0.12.1)Downloading https://files.pythonhosted.org/packages/1c/fc/dad5eaaab68f0c21e2f906a94ddb98175662cc5a654eee404d59554ce0fa/pyglet-1.3.2-py2.py3-none-any.whl (1.0MB)100% |████████████████████████████████| 1.0MB 10kB/s Requirement already satisfied: chardet<3.1.0,>=3.0.2 in d:anaconda3_520libsite-packages (from requests>=2.0->gym==0.12.1) (3.0.4) Requirement already satisfied: idna<2.7,>=2.5 in d:anaconda3_520libsite-packages (from requests>=2.0->gym==0.12.1) (2.6) Requirement already satisfied: urllib3<1.23,>=1.21.1 in d:anaconda3_520libsite-packages (from requests>=2.0->gym==0.12.1) (1.22) Requirement already satisfied: certifi>=2017.4.17 in d:anaconda3_520libsite-packages (from requests>=2.0->gym==0.12.1) (2018.4.16) Collecting future (from pyglet>=1.2.0->gym==0.12.1)Downloading https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz (829kB)100% |████████████████████████████████| 829kB 11kB/s Building wheels for collected packages: futureRunning setup.py bdist_wheel for future ... doneStored in directory: C:UserslwAppDataLocalpipCachewheels0c61d2d6b7317325828fbb39ee6ad559dbe4664d0896da4721bf379e Successfully built future distributed 1.21.8 requires msgpack, which is not installed. Installing collected packages: future, pyglet, gymRunning setup.py develop for gym Successfully installed future-0.17.1 gym pyglet-1.3.2 You are using pip version 10.0.1, however version 19.0.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.以上僅安裝了基本的gym,下面安裝相關游戲:
pip以上總是報錯,需要make ,改用其他試試。
#pip install gym-2048 失敗 pip install --no-index -f https://github.com/Kojoley/atari-py/releases atari_py(base) F:cmp_datarlgympybox2d-master> (base) F:cmp_datarlgympybox2d-master>pip install --no-index -f https://github.com/Kojoley/atari-py/releases atari_py Looking in links: https://github.com/Kojoley/atari-py/releases Collecting atari_pyDownloading https://github.com/Kojoley/atari-py/releases/download/0.1.7/atari_py-0.1.7-cp36-cp36m-win_amd64.whl (673kB)100% |████████████████████████████████| 675kB 17kB/s Requirement already satisfied: six in d:anaconda3_520libsite-packages (from atari_py) (1.11.0) Requirement already satisfied: numpy in d:anaconda3_520libsite-packages (from atari_py) (1.14.3) Installing collected packages: atari-py Successfully installed atari-py-0.1.7多次重復,在早晨才安裝成功。或者直接到Kojoley/atari-py下載:atari_py-0.1.7-cp36-cp36m-win_amd64.whl ,再pip安裝。
box2d_py 安裝
先到 Download SWIG 中下載 swigwin-3.0.12 ,下載完后,解壓縮 d:/swigwin-3.0.12,然后打開 系統環境變量設置,把 d:/swigwin-3.0.12 添加到 path 變量中,重啟機器或者重啟 explorer.exe,然后執行:
pip install box2d-py
git上下載baseline,cd進入目錄,安裝baseline,網絡總出異常,重復多次,早上6點起來安裝,成功。
(base) F:cmp_datarlgymbaselines-master>pip install -e .6 心電
實用心電學雜志中的心電操作指南:標 準 12 導 聯 心 電 圖 包 括 3 個 肢 體 導 聯 ( Ⅰ、 Ⅱ、Ⅲ) 、 3 個 加 壓 單 極 肢 體 導 聯 ( aVR、 aVL、 aVF) 和 6個 胸 壁 導 聯 ( V 1 ~ V 6 ) 。 [圖文]心電散點圖 - 百度文庫,好文接受各圖:[圖文]心電圖測量及各波特點 - 百度文庫
參考文檔:
https://blog.csdn.net/qy13913453196/article/details/82589792
Windows10下用Anaconda3安裝TensorFlow教程 - 星辰之衍 - 博客園
https://blog.csdn.net/wmy199216/article/details/80244702
https://blog.csdn.net/u013745804/article/details/78408148
windows python3 安裝 openai gym 的 atari_py 和 box2d_py: https://blog.csdn.net/ONE_SIX_MIX/article/details/85649152
哈哈
總結
以上是生活随笔為你收集整理的tensorflow命令行安装失败_2019-1 强化学习入坑记之ancanda安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 开源资产管理系统_开源cmdb来啦 通用
- 下一篇: 如何进入python程序代码编辑环境_P