首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CNTK中大文件的CTF阅读器抛出错误

CNTK中大文件的CTF阅读器抛出错误
EN

Stack Overflow用户
提问于 2016-12-27 05:44:53
回答 1查看 308关注 0票数 2

我正在使用一个CTF阅读器函数,下面是关于Github的CNTK教程。

代码语言:javascript
复制
def create_reader(path, is_training, input_dim, label_dim):
    return MinibatchSource(CTFDeserializer(path, StreamDefs(
        features = StreamDef(field='x', shape=input_dim, is_sparse=True),
        labels = StreamDef(field='y', shape=label_dim, is_sparse=False)
    )), randomize=is_training, epoch_size= INFINITELY_REPEAT if is_training else FULL_DATA_SWEEP)

这完全可以工作,除非输入文件大小大于某个大小(未知)。然后抛出如下错误:

代码语言:javascript
复制
WARNING: Sparse index value (269) at offset 8923303 in the input file (C:\local\CNTK-2-0-beta6-0-Windows-64bit-CPU-Only\cntk\Examples\common\data_pos_train_balanced_ctf.txt) exceeds the maximum expected value (268).
attempt: Reached the maximum number of allowed errors while reading the input file (C:\local\CNTK-2-0-beta6-0-Windows-64bit-CPU-Only\cntk\Examples\common\data_pos_train_balanced_ctf.txt)., retrying 2-th time out of 5...
.
.
.

RuntimeError: Reached the maximum number of allowed errors while reading the input file (C:\local\CNTK-2-0-beta6-0-Windows-64bit-CPU-Only\cntk\Examples\common\data_pos_train_balanced_ctf.txt).

我发现这类错误正在TextParser.cpp https://github.com/Microsoft/CNTK/blob/5633e79febe1dc5147149af9190ad1944742328a/Source/Readers/CNTKTextFormatReader/TextParser.cpp文件中抛出。

解决或解决这个问题的方法是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-12-27 18:54:25

您需要知道输入的维度,还需要知道索引从0开始。因此,如果您创建了一个输入文件,将词汇表映射到范围1至20000,则维度为20001。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41339649

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档