lumina37/rotate-captcha-crack

执行train.py的时候报错

Closed this issue · 5 comments

Traceback (most recent call last):
  File "train.py", line 97, in <module>
    train_loss = total_train_loss / steps
ZeroDivisionError: float division by zero

确定图片文件夹里都是jpg后缀的图片文件吗,如果是jpeg或者png的话要修改config.toml

确定图片文件夹里都是jpg后缀的图片文件吗,如果是jpeg或者png的话要修改config.toml

都是jpg,config.toml里边也是jpg
print(img_paths)出来的列表也都读取到文件路径了
还是这个错误

# python train.py
[WindowsPath('data/baiduCaptcha/1615096412.jpg'), WindowsPath('data/baiduCaptcha/1615096414.jpg'), WindowsPath('data/baiduCaptcha/1615096416.jpg'), WindowsPath('data/baiduCaptcha/1615096417.jpg'), WindowsPath('data/baiduCaptcha/1615096419.jpg'), WindowsPath('data/baiduCaptcha/1615096421.jpg'), WindowsPath('data/baiduCaptcha/1615096422.jpg'), WindowsPath('data/baiduCaptcha/1615096424.jpg'), WindowsPath('data/baiduCaptcha/1615096426.jpg'), WindowsPath('data/baiduCaptcha/1615096427.jpg'), WindowsPath('data/baiduCaptcha/1615096429.jpg'), WindowsPath('data/baiduCaptcha/1615096430.jpg'), WindowsPath('data/baiduCaptcha/1615096432.jpg'), WindowsPath('data/baiduCaptcha/1615096434.jpg'), WindowsPath('data/baiduCaptcha/1615096436.jpg'), WindowsPath('data/baiduCaptcha/1615096437.jpg'), WindowsPath('data/baiduCaptcha/1615096439.jpg'), WindowsPath('data/baiduCaptcha/1615096441.jpg'), WindowsPath('data/baiduCaptcha/1615096443.jpg'), WindowsPath('data/baiduCaptcha/1615096444.jpg'), WindowsPath('data/baiduCaptcha/1615096446.jpg'), WindowsPath('data/baiduCaptcha/1615096448.jpg'), WindowsPath('data/baiduCaptcha/1615096449.jpg'), WindowsPath('data/baiduCaptcha/1615096451.jpg'), WindowsPath('data/baiduCaptcha/1615096453.jpg'), WindowsPath('data/baiduCaptcha/1615096455.jpg'), WindowsPath('data/baiduCaptcha/1615096456.jpg'), WindowsPath('data/baiduCaptcha/1615096458.jpg'), WindowsPath('data/baiduCaptcha/1615096459.jpg'), WindowsPath('data/baiduCaptcha/1615096461.jpg')]

Traceback (most recent call last):
  File ".\train.py", line 100, in <module>
    train_loss = total_train_loss / steps
ZeroDivisionError: float division by zero

训练图片用的也是 这里的图

使用 Landscape-Dataset 图集训练的时候,会报这个错:

Traceback (most recent call last):
  File ".\train.py", line 83, in <module>
    source: Tensor = source.to(device=device)
AttributeError: 'int' object has no attribute 'to'

source怎么会是int,我这复现不出来
还有训练用的数据量不到64的话直接就droplast了,到64的量级才能读出一个batch