Conda install tensorflow-mkl -c anaconda Besides the install method described above, Intel Optimization for TensorFlow is distributed as wheels, docker images and conda package on Intel channel. Follow one of the installation procedures to get Intel-optimized TensorFlow.
I have been trying to install tensorflow via Conda for a couple days now with no luck.
I made a fresh install of anaconda3/miniconda3 followed the steps to fix the .bash_profile
issue. Then
$ conda create -n tensorflow pip python=3.6
seems to work. However
$ source activate tensorflow
does nothing. I tried conda activate tensorflow
and nothing. If I type conda info
I can see that the tensorflow env is running. But I have no ability to type within it?
3 Answers
Welcome to Python and Tensorflow. This bit really takes a long time to figure out unless somebody told you how to do so.
Follow this. Assume you installed Miniconda (then python is automatically installed) and you are using linux (cuz you mentioned 'source')
You want to make an conda environment named 'ai3' and you wanna install many packages like tensorflow within 'ai3' env.
In your command line,1) Create ai3 env: see https://conda.io/docs/user-guide/tasks/manage-environments.html for details
2) Log your current command window into the ai3 env
3) Install packages, for example tensorflow: details in https://www.tensorflow.org/install/install_linux but that does not really help FOBs
$ pip install tensorflow
4) Enter yes whenever your command window asks sth. Once it's done, then you wish to use tensorflow (TF) in python. Do this
4-1-0) Obviously you don't wanna do this all the time. Download Pycharm community edition (in https://www.jetbrains.com/pycharm/download/#section=linux) and install.4-1-1) Create a new project in any location you like with interpreter 'ai3'. Interpreter is the env you just prepared in step 1,2,3): click 'add local' by clicking a button at the right end of the 'Interpreter' line -> a python file at '/miniconda3/envs/ai3/bin/python'
5) Now work with many tutorials out there on this setup
sdr2002sdr2002First you need to check the naming convention you are using. I know that's how documentation suggests, but I think it's misleading.
Name your environment according to what you want to be doing inside of it. Tensorflow is a package (that can be a python package) that you will use inside of the environment so you can name it something like:
Also if you just installed Anaconda you do not need to specify the python designation.
Then you need to activate your environment with source activate (whatever you named your conda env)
Next you can install with :
Finally instantiate python and then you can import tensorflow with :
I suggest you refer back to the tensorflow documentation as it's all there. Good luck!
You should first give a name to your environment then give package names that you want to install ie. conda create -n tensorflow_env tensorflow
Easiest way for me at least.
Not the answer you're looking for? Browse other questions tagged tensorflowanacondaconda or ask your own question.
How to Install TensorFlow
In this install tensorflow article, we would first get a general overview of TensorFlow and its use in the Data Science ecosystem, and then we would install TensorFlow for Windows.
What is TensorFlow?
TensorFlow is a software application, popular for implementing Machine Learning algorithms particularly neural networks. It was developed by Google and released as an open-source platform in 2015. It’s called TensorFlow because it takes input as multi-dimensional arrays which are also known as Tensors. We could construct a flowchart of operations that we want to perform on that input, i.e. data goes in at one end and then flows through this system of operations and comes out the other end as output. TensorFlow is popular because of its extreme versatility. It could be run on different platforms like desktop, or a cloud or in a mobile device. All of this could be done using a single API. It could be trained on multiple machines, and then we could run it on a different machine. TensorFlow is very fast because it’s written in C++, but it can be accessed and controlled by other languages, mainly Python. Another great feature of TensorFlow is TensorBoard which enables us to monitor graphically and visually the work of a TensorFlow. Someone who is interested in Machine Learning especially neural network should learn TensorFlow.
Hadoop, Data Science, Statistics & others
Data Flow Graph Architecture of TensorFlow
A Data Flow graph has two basic units: A Node representing a mathematical operation, and an edge which serves a multi-dimensional array known as tensors. So, this high-level abstraction shows how the data flows between operations. Once the graph is created, an inner loop is written to drive computation. Inputs are fed into nodes through variables or placeholders. In TensorFlow, computations are run only after the session is created.
Why TensorFlow is preferred in Deep Learning?
Deep Learning is a part of Machine Learning that learns features and tasks directly from the data. The data could be images, text or sound. It is often referred to as end-to-end learning. A neural network is synonymous to the neurons in our brain. In the above diagram, data comes from the input layer and flows across hidden layers where all the computations are done and then passes on to the output layer. Multiple hidden players make it a deep neural network, whereas a single layer forms a shallow neural network
- TensorFlow has broad built-in support for Deep Learning and neural networks, so it’s easy to assemble net, assign parameters, and run the training process.
- There are trainable mathematical functions that are useful for neural networks. Any gradient based machine learning algorithm will benefit from TensorFlow’s auto-differentiation and suite of first-rate optimizers.
- TensorFlow is compatible with various machine learning due to its extensive collection of flexible tools.
- A Deep Neural Network handles more complex behavior where each input is processed by activation functions like Hyperbolic Tangent, Logistic function, etc. The choice of activation function affects the network’s behavior, and TensorFlow gives control over the network’s structure.
- TensorFlow could also be used in building simple Linear and Non-Linear models.
Steps to Install TensorFlow
The installation part will consist of two parts: –
- Installing Anaconda
- Setting up TensorFlow using Anaconda Prompt.
Part 1: Install Anaconda on Windows
Anaconda is a bundle of some popular python packages and has a package manager called conda (similar to pip). Some of the popular anaconda packages are – numpy, scipy, Jupiter, nltk, scikit-learn, etc. If you have Python installed in your windows, then to install all these packages, you need to run pip, whereas if you install anaconda, you get all these packages at one shot.
Below steps illustrates how to install Anaconda on windows. Python 3.7 doesn’t support TensorFlow, so we will use Anaconda for Python 3.6.
- Download Anaconda for Python 3.6 installer from here – https://drive.google.com/open?id=12BLpz3wzsyI0kFcMgv0SGPj__0op-JJs
- Once the installer has been download, double-click on it and selects Next.
- Click I Agree in the next window.
- Select All Users, and Click Next.
- Choose the Install Location as you deem appropriate and click Next.
- In the next window, Check the ‘Register Anaconda as the system Python 3.6’ box and click Install.
- Installation is in progress.
- Let the installation continue and once finished, click Next to complete it. Then go to Environment variables in windows to set the path.
- Click on New and add the Scripts folder where you have installed Anaconda and click Ok.
- Now, Go to Windows Search Bar and type Anaconda Prompt. Double click the app and type conda –version to confirm its install.
Part 2: Setting up TensorFlow Install using Anaconda Prompt
- Go to Anaconda Prompt and type conda create -n myenv python=3.6 and hit enter.
- Press Y and hit Enter. It will create a separate environment install TensorFlow
- Type conda activate myenv and enter Enter to go inside the environment.
- Once you are into the environment, enter the following one by one
- conda install jupyter
- conda install scipy
- pip install –upgrade tensorflow
- Once it is done, Type python and then types import tensorflow. If no error is there, then it is successfully TensorFlow install.
Practical Applications of TensorFlow
Deep Learning has emerged at the heart of nearly every major computational breakthrough in the last few years. It’s already in many of our daily products like Netflix and Amazon’s personalized recommendations, spam filtering, and even our interaction with personal assistants like Apple Siri or Microsoft Cortana.
However, it’s not only science applications that are benefitting from this research. People from other disciplines are also starting to explore how deep learning could be used in cases like Object Detection (as shown in the image). It teaches the computer to recognize an object in a picture and then use this knowledge to drive new behaviors.
Latest Trends Of TensorFlow
TensorFlow recently released its 1.12.0 version in which few of the major improvements are: –
- Keras model could be directly exported to the SavedModel format and used with TensorFlow spring.
- Binaries are built with XLA support, and Keras models could now be evaluated with tf.data.Dataset.
- Ignite Dataset added to contrib/ignite that allows working with Apache Ignite.
Recommended Articles
This has been a guide on How To Install TensorFlow Here we have discussed the Instructions and different steps to install TensorFlow. You may also look at the following article to learn more –
Data Science Course - All in One Bundle
360+ Online Courses
1500+ Hours
Verifiable Certificates
Lifetime Access