TensorFlow CIFAR10 示例 [英] TensorFlow CIFAR10 Example

查看:25
本文介绍了TensorFlow CIFAR10 示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用来自 SVHN 的数据按原样运行整个 CIFAR10.

I am trying to run the entire CIFAR10 as is, with data from SVHN.

http://ufldl.stanford.edu/housenumbers/

我以与 Alex Krizhevsky 网站上的 bin 文件完全相同的格式对数据进行了格式化.

I formatted the data in the exact format as the bin file from Alex Krizhevsky's website.

http://www.cs.toronto.edu/~kriz/cifar.html

我没有编辑代码,只是更改了一些变量名称以使其在另一个目录中工作.它现在给我一个错误.

I did not edit the code, other than changing a few variable names to make it work in another directory. It gives me an error now.

W tensorflow/core/common_runtime/executor.cc:1076] 0x218fec0 Compute status: Invalid argument: Indices are not valid (out of bounds).  Shape: dim { size: 128 } dim { size: 10 }
 [[Node: SparseToDense = SparseToDense[T=DT_FLOAT, Tindices=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](concat, SparseToDense/output_shape, SparseToDense/sparse_values, SparseToDense/default_value)]]

具体来说,cifar.py 中失败的那一行是:

Specifically, the line that fails in cifar.py is:

dense_labels = tf.sparse_to_dense(concated,[FLAGS.batch_size, NUM_CLASSES],1.0, 0.0)

我也检查了这个解决方案,它不起作用.

I have checked this solution too, it does not work.

TensorFlow 索引无效(越界)

有人知道如何使它工作吗?

Anyone has any idea on how to make it work?

推荐答案

我意识到了错误.SVHN 数据集给数字 0 的值是 10,而不是 0.我从一开始就做出了这个致命的假设,浪费了我很多时间.

I realized the mistake. The SVHN dataset gave the number 0 a value of 10, instead of 0. I made this fatal assumption from the start and it wasted a lot of my time.

给定 10 个类,标签的范围应为 0-9,包括 0-9.发生错误是因为标签的范围是 1-10.

Given 10 classes, the labels should range from 0-9, inclusive. The error happened because the labels ranged from 1-10.

http://ufldl.stanford.edu/housenumbers/

以后记得阅读概述!

这篇关于TensorFlow CIFAR10 示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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