-
Notifications
You must be signed in to change notification settings - Fork 876
Add data feeder api guide #329
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
Add data feeder api guide #329
Conversation
luotao1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这篇是否应该和数据输入输出放在一块?
另外,报个错,上述链接中下图跳转失败。

| place = fluid.CUDAPlace(0) if fluid.core.is_compiled_with_cuda() else fluid.CPUPlace() | ||
| feeder = fluid.DataFeeder(feed_list=[image, label], place=place) | ||
|
|
||
| 其中,:code:`feed_list` 参数为变量列表,这些变量往往由 :code:`fluid.layers.data()` 创建, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些变量往往由,“往往”的意思是还有别的创建方式?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix.
| feeder = fluid.DataFeeder(feed_list=[image, label], place=place) | ||
|
|
||
| 其中,:code:`feed_list` 参数为变量列表,这些变量往往由 :code:`fluid.layers.data()` 创建, | ||
| :code:`place` 参数表示应将Python端传入的numpy array等数据转换为GPU端的 :code:`LoDTensor` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
转换为GPU端或是CPU端的:code:LoDTensor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix.
| 会完成数据类型和维度的转换。若 :code:`feed_list` 中的变量的 :code:`lod_level` 不为零,则Fluid会将经维度转换后的 | ||
| :code:`iterable` 中每行数据的第0维作为返回结果的 :code:`LoD`。 | ||
|
|
||
| 具体使用方法请参见 :ref:`api_fluid_DataFeeder` 。 No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:ref:api_fluid_DataFeeder 应该是可以调整链接了,但从预览截图里没有显示。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可能是因为在预览的时候没有加到API的树下,导致内链失败,@tink2123 在电脑上尝试,是可以的
| 则可传入Python int、float等类型数据。:code:`image_i` 与 :code:`label_i` 的数据类型和维度不必 | ||
| 与 :code:`fluid.layers.data()` 创建时指定的 :code:`dtype` 和 :code:`shape` 完全一致,:code:`DataFeeder` 内部 | ||
| 会完成数据类型和维度的转换。若 :code:`feed_list` 中的变量的 :code:`lod_level` 不为零,则Fluid会将经维度转换后的 | ||
| :code:`iterable` 中每行数据的第0维作为返回结果的 :code:`LoD`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
经维度转换后-》经过维度转换后?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix.
5ccb7e7 to
358a3ff
Compare
shanyi15
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
* [cherry-pick] Fix v0.2 docs (PaddlePaddle#258) * fix save checkpoint in quantization (PaddlePaddle#257) * fix save checkpoint in quantization * fix details * Fix softlink (PaddlePaddle#256) Co-authored-by: Liufang Sang <[email protected]> * [cherry-pick] add prune benchmark (PaddlePaddle#262) * add prune model latency (PaddlePaddle#260) & fix run command for windows (PaddlePaddle#261) * Cherry-pick update reader config (PaddlePaddle#269) * Force `cudnn` backend for depthwise convs when fp16 is enabled (PaddlePaddle#271) * fix weights path (PaddlePaddle#274) * cherry-pick refine fruit config (PaddlePaddle#289) * cherry-pick polish doc (PaddlePaddle#287) * cherry-pick fix oidv5 link (PaddlePaddle#296) cherry-pick fix oidv5 link * [cherry-pick] polish slim model zoo (PaddlePaddle#313) * polish slim README * refine pedestrian_yolov3_darknet.yml and vehicle_yolov3_darknet.yml in contrib (PaddlePaddle#324) * fix yolo configs (PaddlePaddle#332) * cherry pick polish doc (PaddlePaddle#329) * refine config (PaddlePaddle#336) * [cherry pick] refine sensitive link (PaddlePaddle#334) * refine sensitive link * add YOLOv3Loss.batch_size comments (PaddlePaddle#348) * add deploy with python * update README * support TRT and Executor * update cpp_infer for paddle latest * support fixed shape of model * polish code * supoort trt * support TRT&Executor * deploy/python : fix coding style problems * update requirements.txt * update deploy/python docs Co-authored-by: Guanghua Yu <[email protected]> Co-authored-by: Liufang Sang <[email protected]> Co-authored-by: Kaipeng Deng <[email protected]> Co-authored-by: wangguanzhong <[email protected]> Co-authored-by: Yang Zhang <[email protected]> Co-authored-by: littletomatodonkey <[email protected]> Co-authored-by: FlyingQianMM <[email protected]> Co-authored-by: Channingss <[email protected]>
Fix #296
