TensorFlow 无属性 'make_template'

TensorFlow no attribute 'make_template'

我正在尝试熟悉 tensorflow 和神经网络。我最近在尝试使用 tensorflow.make_template() 时遇到了这个问题。我首先注意到我使用的 IDE 中没有自动完成选项,然后我只是尝试从 python cmd:

调用该函数
$ python
Python 2.7.10 (default, Oct 14 2015, 16:09:02) 
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.make_template()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'make_template'
>>> 

我是从源码安装的tensorflow,安装的protobuf版本是:

$ git submodule status 
 55ad57a235c009d0414aed1781072adda0c89137 google/protobuf (v3.0.0-alpha-4-179-g55ad57a)

到目前为止,我还没有遇到过任何与其他 tensorflow 函数类似的行为。 关于导致此问题的问题有什么想法吗?

如评论中所述,此问题是由于安装的 TensorFlow (0.5.0) 版本与下载的源 (0.6.0) 不匹配造成的。

要升级到 TensorFlow 的最新开发版本,请根据该来源按照 install from source, then build and install the PIP package 的说明进行操作。