I am new to tensorflow. When I am using import tensorflow.contrib.learn.python.learn
for using the DNNClassifier it is giving me an error: module object has no attribute python
Python version 3.4 Tensorflow 1.7.0
If all you need is DNNClassifier
, then use
from tensorflow.contrib.learn import DNNClassifier
If you need the whole library, use import tensorflow.contrib.learn
.
For completion, here are the docs for DNNClassifier
showing it is under tensorflow.contrib.learn
. In general, you never need to include the ...python
in your tensorflow import statements.
tensorflow.contrib.learn module does not have python module, as error message suggests. You can import DNNClassifier the following way:
from tensorflow.contrib.learn import DNNClassifier
It looks like you have an error in your import statement. Try
from tensorflow.contrib.learn import DNNClassifier
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.