Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data reader for api #1326

Closed
wants to merge 1 commit into from
Closed

Conversation

qingqing01
Copy link
Contributor

@qingqing01 qingqing01 commented Feb 13, 2017

参考 1108 提供通用的CacheAllDataPool写法。

  • 不同于 1325 的是,例如batch_size=128, 这个每次产生的数据batch是:
[ [image, label],  # 一条样本
  [image, lable],  # 一条样本
  [image, lable],
  ....  ]   #也就是128个list,each_iterm是(image, label)

这样送入paddle.train的时候,数据要转换为 [[image], [image], ...], [lable, label, label] 两个slot?

  • 1325 产生的数据直接是:
image[0: 128], label[0:128]  #也就是2个slot,第0个是 128 x 784的二维数组, 第1个是128x1的一维数组


def next(self):
if self.__idx__ >= len(self.__pool__):
raise StopIteration()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看网上的教程用的是raise StopIterationraise StopIteration()也行吗?

@qingqing01 qingqing01 closed this Feb 24, 2017
@qingqing01 qingqing01 deleted the api_data branch July 7, 2017 13:35
wangxicoding pushed a commit to wangxicoding/Paddle that referenced this pull request Dec 9, 2021
* fix ofa export bug

* support bert export
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants