Work on Jupyter Notebook with Keras & Tensorflow with Conda Virtualenv on Ubuntu

  • Keep your system tidy: Multiple packages, different versions of python and Deep Neural Network (DNN) framework makes your system cluttered. Virtual Environment serves as an independent environment, the programs inside won’t affect your system.
  • Be able to work with different versions of software: Given a python 2.7 program while the version of python in your system is 3.6? Install python 2.7 with virtual environment!
  • Easy to manage: With Anaconda, you can easily upgrade, downgrade, mass-install packages you need for programs.
  1. Install Anaconda: firstly you need to install Anaconda or Miniconda.
  • Anaconda (Recommended, as the full version):
bash Anaconda-latest-Linux-x86_64.sh
  • Miniconda:
bash Miniconda3-latest-Linux-x86_64.sh
conda create -n myenv python=3.6
source activate myenv
source deactivate myenv
pip install --ignore-installed --upgrade tfBinaryURL
pip install --ignore-installed --upgrade \ https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp36-cp36m-linux_x86_64.whl
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
>>> Hello, Tensorflow!
pip install keras
pip install ipykernel
python -m ipykernel install --user --name=myenv
jupyter notebook

--

--

Computer Vision Applied Scientist @ Amazon. https://coldmanck.github.io

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store