简体   繁体   中英

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:

module 'tensorflow' has no attribute 'python'

Why is that?

Tensorflow's __init__.py manually removes the python name from the tensorflow module's namespace :

del python

The contents of the tensorflow.python submodule should be accessed through tensorflow directly.

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.

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