2017-12-08 4 views
2
import tensorflow.contrib.learn.python.learn as learn 

home/michael/miniconda3/lib/python3.6/importlib/_bootstrap.py:219: 
RuntimeWarning: compiletime version 3.5 of module 
'tensorflow.python.framework.fast_tensor_util' does not match runtime 
version 3.6 
return f(*args, **kwds) 
--------------------------------------------------------------------------- 
AttributeError       Traceback (most recent call last) 
<ipython-input-1-630a74eb6a34> in <module>() 
----> 1 import tensorflow.contrib.learn.python.learn as learn 

AttributeError: module 'tensorflow.contrib.learn' has no attribute 'python' 

Ich versuche, diese Bibliothek in Jupyter in Linux-Umgebung zu importieren, und ich konnte keine Antwort auf Google finden.Modul 'tensorflow.contrib.learn' hat kein Attribut 'Python'

Antwort

1

Eigentlich ist das Modul tensorflow.contrib.learn Reimporten alles von tensorflow.contrib.learn.python.learn:

91 # pylint: disable=wildcard-import 
92 from tensorflow.contrib.learn.python.learn import * 
93 # pylint: enable=wildcard-import 
94 
95 from tensorflow.contrib.learn.python.learn import learn_runner_lib as learn_runner 

So können Sie es einfach direkt importieren:

import tensorflow.contrib.learn as learn 

oder

from tensorflow.contrib import learn 
Verwandte Themen