twitter facebook

python で tensorflow(GPU版)とKeras のセットアップ

conda で python3.5 をインストール

python3.5 で環境作成します。 python3.7 とかでは tensorflow-gpu でインストールエラーがでるので。 -n test は適当な名前で。
conda create -n test anaconda python=3.5
ちょっと時間はかかりました。
仮想環境 test に移動して、python のバージョンをチェック。
activate test
python -V
Python 3.5.5 :: Anaconda, Inc.

tensorflow-gpu のインストール

3.5.5 なら問題なくインストールできるはず。
pip install tensorflow-gpu
Collecting tensorflow-gpu Could not find a version that satisfies the requirement tensorflow-gpu (from versions: ) No matching distribution found for tensorflow-gpu You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
pip をアップグレードしろと言われたので、pip のアップグレード
python -m pip install --upgrade pip
再度
pip install tensorflow-gpu
いけました。

keras のインストール

pip install keras
~ Successfully installed keras-applications-1.0.2 keras-preprocessing-1.0.1

おまけのエラーメモ

2018年10月現在は tensorflow-gpu は Python3.5.x でないとダメっぽいです。
Could not find a version that satisfies the requirement tensorflow-gpu
pip install tensorflow-gpu
Collecting tensorflow-gpu Could not find a version that satisfies the requirement tensorflow-gpu (from versions: ) No matching distribution found for tensorflow-gpu
python -V Python 3.7.0
AUTHOR
@hiropon
最終更新日 2018/10/12
FAVORITE good stock
LINK TAG
記法を見る