简体   繁体   English

模块'tensorflow'没有属性'python'

[英]Module 'tensorflow' has no attribute 'python'

If I run this code: 如果我运行此代码:

import tensorflow as tf

print(tf.VERSION)

pyt = tf.python

I get version 1.6.0, but also the error: 我得到的版本是1.6.0,但也有错误:

module 'tensorflow' has no attribute 'python'

Why is that? 这是为什么?

Tensorflow's __init__.py manually removes the python name from the tensorflow module's namespace : Tensorflow的__init__.py tensorflow模块的命名空间中手动删除python名称

del python

The contents of the tensorflow.python submodule should be accessed through tensorflow directly. tensorflow.python子模块的内容应直接通过tensorflow访问。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM