Introducing keras on virtual environment (pyenv: anaconda) on server by conda (tensorflow backend)

Anaconda2 and 3 virtual environments have already been installed in pyenv.

Introducing Tensorflow

--tensorflow installation Use Anaconda install (https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#pip-installation)

	$ conda create -n tf-cpu python=3.5
	$ conda install -c conda-forge tensorflow

--Checking the anaconda virtual environment

	$ conda env list
	tf-cpu                *  ~/pyenv/versions/anaconda3-4.1.0/envs/tf-cpu
	root					 ~/.pyenv/versions/anaconda3-4.1.0
	
	$ conda create -n tf-cpu python=3.5
	$ conda install -c conda-forge tensorflow

--Adding environment variables If you write appropriate code in .ipython/profile_default/startup/, it seems to be executed automatically at startup. Added the following to hoge.py

	> import sys
	> sys.path.append('~.pyenv/versions/anaconda3-4.1.0/envs/tf-cpu/lib/python3.5/site-packages/')

--Introduction of keras Only one line. Super easy (https://keras.io/ja/#_2)

	> pip install keras

--Usually, you can switch the environment with source activate tf-cpu, but it seems that you have to specify it with an absolute path on pyenv, so it is troublesome, so make it alias. I haven't changed the backend yet, and some people have written it, so I'll omit it.

	$ tf-cpu
	$ ipython
	In [1]: import tensorflow
	In [2]: import keras
	Using TensorFlow backend.
	In [3]: 

Ok.

pyenv, vurtialenv, pyenv-virtualenv and conda

(http://dackdive.hateblo.jp/entry/2015/12/12/163400) Since it was described in detail in, a memo   pyenv: Version control of python, only one virtual environment for each version   vurtialenv: You can create a virtual environment with the same version   pyenv-virtualenv: It seems that pyenv can be given any name.   conda: I forgot, but I think conda is upward compatible with pyenv somewhere, so I plan to use this for the time being.

Recommended Posts

Introducing keras on virtual environment (pyenv: anaconda) on server by conda (tensorflow backend)
Try to build python and anaconda environment on Mac (by pyenv, conda)
[Environment construction] @anaconda that runs keras / tensorflow on GPU
Python environment construction (pyenv, anaconda, tensorflow)
How to easily switch the virtual environment created by Conda on Jupyter
[Memo] Build a virtual environment with Pyenv + anaconda
[Node-RED] Execute Python on Anaconda virtual environment from Node-RED [Anaconda] [Python]
Create a virtual environment with Anaconda installed via Pyenv
Notes on creating a virtual environment with Anaconda Navigator
Use Anaconda in pyenv environment
Anaconda environment construction on CentOS7
Introduced Tensorflow (Win / Anaconda environment)
Build an Anaconda virtual environment
Introducing TensorFlow on Ubuntu + Python 2.7
[Anaconda] Activate the virtual environment
[Tensorflow] Tensorflow environment construction on Windows 10
Environment construction of TensorFlow + JupyterNotebook + Matplotlib on Windows version Anaconda (August 2017 version)