Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • models
  • Issue
  • #974

M
models
  • 项目概览

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

通知 232
Star 6828
Fork 2962
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 602
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 255
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
M
models
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 602
    • Issue 602
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 255
    • 合并请求 255
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 6月 08, 2018 by saxon_zh@saxon_zhGuest

crnn-ctc training: strange awk command and len(img_label_lines) != actual dataset size

Created by: sfraczek

Hi,

I have analysed a little bit the code of DataGenerator in ctc_reader.py and I have minor comments for the code there:

In line https://github.com/PaddlePaddle/models/blob/f93838a4258c2a197cfa9e14c244b4da7a042a88/fluid/ocr_recognition/ctc_reader.py#L67 sizes equals 0 if batch_size equals the total number of images in the dataset. I found this when I set batch_size equal to size of dataset. The result was that there was no iterations calculated at all (instead of one), because the loop in the next line is not executed.

This has led me to the next thing: In the line here https://github.com/PaddlePaddle/models/blob/f93838a4258c2a197cfa9e14c244b4da7a042a88/fluid/ocr_recognition/ctc_reader.py#L51 I have been testing what the command sed 1,$((1 + RANDOM % 100))d is supposed to do. I have left only 5 lines in the img_label_list file. I have then ran the command cat /root/.cache/paddle/dataset/ctc_data/data/train.list | awk '{printf("%04d%.4f %s\n", $1, rand(), $0)}' | sort | sed 1,$(( RANDOM % 5))d and it turns out that it outputs up to 4 lines. One of the lines is always missing. When I tried sed 1,$(( RANDOM % 6))d instead of 1,$(( RANDOM % 5))d, I still got 4 or less lines. The conclusion is that there is always at least one file not present in output. I wonder if that was intended? Does this lead to the first problem above? Also, if I increase the number to 100, the probability of printing empty list increases drastically (I guesss that up to 95%). Is this intended behavior?

Also I found this: https://github.com/PaddlePaddle/models/blob/f93838a4258c2a197cfa9e14c244b4da7a042a88/fluid/ocr_recognition/ctc_reader.py#L43, I found awk applying no change to the result of the previous command, as the file contains only 4 columns.

I couldn't analyse any more of this code part because I had to return to my duties. I hope you can find this useful. :)

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/models#974
渝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