简体   繁体   English

模块'tensorflow.contrib.learn'没有属性'python'

[英]module 'tensorflow.contrib.learn' has no attribute 'python'

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'

I am trying to import this library in jupyter in linux environment, and I could not find any answer on google. 我正在尝试在Linux环境中的jupyter中导入此库,但在google上找不到任何答案。

Actually, the module tensorflow.contrib.learn reimports everything from tensorflow.contrib.learn.python.learn : 实际上,模块tensorflow.contrib.learntensorflow.contrib.learn.python.learn重新导入所有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 you can just import it directly: 因此,您可以直接将其导入:

import tensorflow.contrib.learn as learn

or 要么

from tensorflow.contrib import learn

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError:模块&#39;tensorflow.contrib.learn&#39;没有属性&#39;TensorFlowDNNClassifier&#39; - AttributeError: module 'tensorflow.contrib.learn' has no attribute 'TensorFlowDNNClassifier' 没有名为 tensorflow.contrib.learn 的模块 - No module named tensorflow.contrib.learn AttributeError:模块“ tensorflow.contrib.learn.python.learn.ops”没有属性“ split_squeeze” - AttributeError: module 'tensorflow.contrib.learn.python.learn.ops' has no attribute 'split_squeeze' 模块 tensorflow 没有属性 contrib - module tensorflow has no attribute contrib Tensorflow:没有名为 contrib.learn.python.learn.datasets.mnist 的模块 - Tensorflow: No module named contrib.learn.python.learn.datasets.mnist 模块“tensorflow”没有属性“contrib”,而 - module 'tensorflow' has no attribute 'contrib' while TensorFlow AttributeError:模块tensorflow.contrib.lite.python.lite没有属性TFLiteConverter - TensorFlow AttributeError: module tensorflow.contrib.lite.python.lite has no attribute TFLiteConverter 模块 &#39;tensorflow&#39; 没有 tensorflow 2.0 版本的属性 &#39;contrib&#39; - Module 'tensorflow' has no attribute 'contrib' for the version tensorflow 2.0 AttributeError:模块“tensorflow”在 tensorflow 2.0 中没有属性“contrib” - AttributeError: module 'tensorflow' has no attribute 'contrib' in tensorflow 2.0 导入tensorflow contrib学习python学习 - Import tensorflow contrib learn python learn
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM