Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Machine Learning by (19k points)

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.

1 Answer

0 votes
by (33.1k points)
edited by

You should import tensorflow like the following code:

import tensorflow as tf

For tokenizer, try this:

from tensorflow.contrib.keras.preprocessing.text import Tokenizer

You can check the installed package from the following list:

conda list

Hope this answer helps you!

Learn TensorFlow with the help of this comprehensive video tutorial:

Browse Categories

...