Tensorflow tf.nn.in_top_k Error targets[0] is out of range
2017-07-16 13:04
666 查看
https://stackoverflow.com/questions/38646328/tensorflow-tf-nn-in-top-k-error-targets0-is-out-of-range
越来越发现overstack上的东西含金量很高。这个错误在国内网站上绝种,在overstack上找到了这个以后大致一看就有数了。本质上是生成数据集所包含的label不存在,导致在训练的过程中,在所定义的label集合内找不到与之相匹配的label,导致target out of range。
打个比方,比如你定义label包括cat和dog,然后转成了数字0,1(便于计算),结果出于某种原因,label存成了-1(比如并没找到cat或者dog,返回-1)并存在了tfrecord里面,这时候在训练过程中程序尝试在{0,1}内找-1,肯定是找不到的,于是就报出了out of range的错误。
当然这个只是其中一种可能性,我是在训练分类问题中报错的,比较有针对性,但是如果以后有这种问题,可以多从这个角度出发探讨可能的原因。
越来越发现overstack上的东西含金量很高。这个错误在国内网站上绝种,在overstack上找到了这个以后大致一看就有数了。本质上是生成数据集所包含的label不存在,导致在训练的过程中,在所定义的label集合内找不到与之相匹配的label,导致target out of range。
打个比方,比如你定义label包括cat和dog,然后转成了数字0,1(便于计算),结果出于某种原因,label存成了-1(比如并没找到cat或者dog,返回-1)并存在了tfrecord里面,这时候在训练过程中程序尝试在{0,1}内找-1,肯定是找不到的,于是就报出了out of range的错误。
当然这个只是其中一种可能性,我是在训练分类问题中报错的,比较有针对性,但是如果以后有这种问题,可以多从这个角度出发探讨可能的原因。
相关文章推荐
- mysql error BIGINT UNSIGNED value is out of range in 解决办法
- ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in..的错误 [转]
- Mysql Query error: BIGINT UNSIGNED value is out of range in..解决方法
- [Err] 1690 - BIGINT UNSIGNED value is out of range in
- Mysql ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in..的解决方法
- Server(Admin) start is failing in WLST as outofmemory error permgen space for weblogic 12c
- 机器学习中代码出现tensorflow.python.framework.errors_impl.InternalError,from device: CUDA_ERROR_OUT_OF_MEMORY
- BIGINT UNSIGNED value is out of range in..的解决方法
- Mysql ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in..的解决方法
- What is the meaning of the word logits in TensorFlow?
- MYSQL SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in
- ora-03206 maximum file size of blocks in autoextend clause is out of range
- convolution in tensorflow (tf.nn.conv)
- Mysql ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in..的解决方法
- 关于import tensorflow as tf的错误:AttributeError: type object 'NewBase' has no attribute 'is_abstract'
- tensorflow API: nn.in_top_k 、top_k
- Exception in thread "Timer-2" java.lang.OutOfMemoryError: Java heap space
- scrapy运行问题:IndexError: list index out of range
- ERR value is not an integer or out of range
- The literal of int xxxxx is out of range