Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • Issue
  • #721

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 12月 05, 2016 by saxon_zh@saxon_zhGuest1 of 4 tasks completed1/4 tasks

Defects of Python API

Created by: reyoung

The Python API of Paddle is developed originally for Paddle model inference and custom Paddle training progress. It was an experimental project for Paddle and just exposed every APIs from C++ when developer using it. It is important to have a plan for python API and fix some essential defects about it.

The defects of API are listed below:

  • In Paddle, there are many global variables, which may lead to some error when loading multiple models. Related issue #601 (closed).

    • The command line flags are global variables, but some of them should be configured by each neural network, instead of global variables.

      • FLAGS_use_gpu is used to configure a neural network using GPU or not. When using paddle train, there is one neural network trained by Paddle, so the global variable use_gpu doesn't matter. However, it is reasonable for users to train multiple neural networks in one program when using Paddle as a library.

      • FLAGS_gpu_id is not appropriate for the same reason as above. The possible flags are in Flags.h.

    • The global variables in configuration file parser.

      • In trainer config helpers, there are some decorators use global variables. It should be fixed or give an easy way to reset global variables.
    • There may be other global variables which are not listed here.

  • The LOG(FATAL) and CHECK errors in Paddle.

    • The design philosophy in Paddle is crash as soon as possible. There are many LOG(FATAL) and CHECK in Paddle code. How to handle them correctly in Paddle library is very important. Because it should not exit the user program when some operations are illegal.
  • The PyDataProvider2 and the config file parsing in Paddle process.

    • There is a python interpreter embedded inside Paddle to parsing configuration file and loading data. It forces users to split one python script to three scripts when using Python library.
    * Also, the process model is very confusing. The call stack when using python library will be `Python => Paddle => Python`. The two python interpreters in one process may share some global variable, lead to some unknown behaviour.
  • The c++ APIs are not all exposed. Several levels of APIs for Paddle are listed below.

    • The Trainer API. Trainer API is the highest level API. It contains loadModel, trainOnePass, trainOneMiniBatch, etc. They were exposed and we should check whether current API is enough for Trainer.

    • The GradientMachine API. The Gradient Machine is an abstract for the neural network. By using GradientMachine API, users can customise training progress. Users can forward a neural network 10 times, and do backwards. This API were partially exposed and we should expose them all.

    • The Layer API. API to control each layer forward and backwards. It seems that these APIs are not useful now, and none of them is exposed.

    • The Matrix API. APIs to use Paddle matrix in Python. They are partially exposed, should work for feeding Data to GradientMachine. We should check whether current API is enough.

    • The Util API. APIs for Paddle utilities, such as threading, networking, etc. None of them is exposed basically, except some API for parsing command line arguments, initialization for Paddle process.

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/Paddle#721
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7