当我import tensorflow as tf
时,我可以访问tf
内的不同包:tf.nn
,tf.train
等
但是访问tensorflow.examples
失败了:
Traceback (most recent call last):
File "interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-4-c704d4902e0c>", line 1, in <module>
tf.examples
AttributeError: 'module' object has no attribute 'examples'
我必须以不同的方式导入它,例如from tensorflow.examples.tutorials.mnist import input_data
,并且只有在tf.examples
解析后才能导入。为什么呢?