复现教程中LeNet眼疾invalid literal for int() with base 10:
收藏
C:\python_pp\python.exe C:/paddle工程/LeNet眼疾.py
C:\python_pp\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp, sys, os
start training....
batch:0, epoch:0, lossis:0.6814
Traceback (most recent call last):
File "C:\paddle工程\LeNet眼疾.py", line 293, in
train_pm(model, optimizer = opt)
File "C:\paddle工程\LeNet眼疾.py", line 185, in train_pm
for batch_id, data in enumerate(valid_loader()):
File "C:\paddle工程\LeNet眼疾.py", line 101, in reader
label = int(line[2])
ValueError: invalid literal for int() with base 10: ''
Process finished with exit code 1
0
收藏
请登录后评论
信息太少了,看不出来
这个错误好像是int()函数里面传入了一个不可以转换成int型数据的字符串,可以把line[2]打印出来看看。
已经解决,数据集里最后一行存在其他字符