hellokuls / cnnyzm

用CNN识别验证码| python识别验证码| 训练验证码模型
Apache License 2.0
191 stars 44 forks source link

修改了图片的长宽,貌似获取的图片生成的验证码里面没有,这个是随机生成的吗 #3

Open remberi opened 3 years ago

remberi commented 3 years ago

64 9965 XkOt.jp 8250 Traceback (most recent call last): File "/Users/rember_i/学习/chinaunicom/train.py", line 214, in train() File "/Users/rember_i/学习/chinaunicom/train.py", line 182, in train batch_x, batch_y = next_batch(64) File "/Users/rember_i/学习/chinaunicom/process.py", line 70, in next_batch batch_y[i, :] = text2vec(text_a) File "/Users/rember_i/学习/chinaunicom/process.py", line 21, in text2vec raise ValueError("验证码超过4位啦!") ValueError: 验证码超过4位啦!

remberi commented 3 years ago
# 返回特定shape图片
def wrap_gen_captcha_text_and_image(shape=(CAPTCHA_HEIGHT, CAPTCHA_WIDTH, 3)):
    t_list = []
    t = file_name("./yzm")
    for i in t:
        index = i.rfind('-')
        name = i[:index]
        t_list.append(name)
    # print(t_list)
    im = load_allimg()

    im_list = []
    for i in range(0, len(im)):
        if im[i].shape == shape:
            im_list.append(im[i])
    # print(len(im_list))
    # print(len(t_list))
    return t_list, im_list

能解释这个函数的意思的吗

remberi commented 3 years ago

确认是读取图片地址的问题,还有请问下这个训练得多久呀

hellokuls commented 3 years ago

确认是读取图片地址的问题,还有请问下这个训练得多久呀

一般推荐训练集越多越好,精准度会更高。

2万图片数量级,大概1-2小时

lsz92cyn commented 3 years ago

为什么我训练的一直都是0.1精度

hellokuls commented 3 years ago

为什么我训练的一直都是0.1精度

多少训练集

lsz92cyn commented 3 years ago

好了,我以为出错了,在1500多次遍历才上升,最后到0.99,但是1万的数据训练了6个小时

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年5月20日(星期四) 晚上6:29 收件人: @.>; 抄送: "风随@@.>; @.>; 主题: Re: [hellokuls/cnnyzm] 修改了图片的长宽,貌似获取的图片生成的验证码里面没有,这个是随机生成的吗 (#3)

为什么我训练的一直都是0.1精度

多少训练集

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

hellokuls commented 3 years ago

好了,我以为出错了,在1500多次遍历才上升,最后到0.99,但是1万的数据训练了6个小时 ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年5月20日(星期四) 晚上6:29 收件人: @.>; 抄送: "风随@@.>; @.>; 主题: Re: [hellokuls/cnnyzm] 修改了图片的长宽,貌似获取的图片生成的验证码里面没有,这个是随机生成的吗 (#3) 为什么我训练的一直都是0.1精度 多少训练集 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

训练集要大,最好2万,训练时间跟机器也有关系的