How to import the Tensorflow libraries in python?

Viewed 64033

A very basic question.

I am trying to install tensorflow library in Anaconda python(spyder).

import tf.contrib.keras.preprocessing

Its is giving me error as "No module found". I also tried import tensorflow.contrib.keras.preprocessing

I also tried from tf.contrib.keras.preprocessing.text import Tokenizer.

This also doesnt work

However I verified this in the tensorflow website, and it is present. The link to the library is https://www.tensorflow.org/api_docs/python/tf/contrib/keras/preprocessing.

I tried to pip and conda install. But that also throwing out error.

From anaconda prompt i typed this:

activate tensorflow 
pip install tf.contrib.keras.preprocessing
conda install tf.contrib.keras.preprocessing

Is there anything i miss out, Please correct me.

2 Answers
Related