tf.contrib.learn快速入门错误,没有名为load_csv的属性 [英] Error in tf.contrib.learn Quickstart, no attribute named load_csv

查看:85
本文介绍了tf.contrib.learn快速入门错误,没有名为load_csv的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在OSX上进入tensorflow,并按照以下pip安装指南安装了最新版本:

I am getting started in tensorflow on OSX and installed the lasted version following the guidelines for a pip installation using:

echo $TF_BINARY_URL
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0rc0-py2-none-any.whl

快速概述:

OS:OS X El Capitan版本10.11.6(15G31)

OS: OS X El Capitan version 10.11.6 (15G31)

Python:通过 brew install python

Python: Python 2.7.12_1 installed with brew install python

TensorFlow:来自的0.11.0rc0将tensorflow导入为tf;打印(tf .__ version __)

TensorFlow: 0.11.0rc0 from import tensorflow as tf; print(tf.__version__)

我可以使用以下命令运行TensorFlow:

I can run TensorFlow using:

python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
>>> Hello, TensorFlow!

因此TensorFlow已安装并正在运行基本命令.

So TensorFlow is installed and running the basic commands.

但是当我从此处运行tf.contrib.learn快速入门的代码时: https://www.tensorflow.org/versions/r0.11/tutorials/tflearn/index.html

But when I run the code for tf.contrib.learn Quickstart from here: https://www.tensorflow.org/versions/r0.11/tutorials/tflearn/index.html

我遇到以下问题:

Traceback (most recent call last):
  File "tf_learn_quickstart.py", line 13, in <module>
    training_set = tf.contrib.learn.datasets.base.load_csv(filename=IRIS_TRAINING,
AttributeError: 'module' object has no attribute 'load_csv'

我无法弄清楚出了什么问题,因为其他所有事情似乎都正常.任何想法有什么问题吗?

I can't figure out what went wrong as everything else seems to be working fine. Any ideas what is wrong?

推荐答案

此功能已被弃用:https://github.com/tensorflow/tensorflow/commit/2d4267507e312007a062a90df37997bca8019cfb

该教程似乎不是最新的.我相信您只需将load_csv替换为load_csv_with_header即可使其正常工作.

And the tutorial seems not up to date. I believe you can simply replace load_csv with load_csv_with_header to get it work.

这篇关于tf.contrib.learn快速入门错误,没有名为load_csv的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆