You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
你好,在使用本工程的代码时发现一个图片标签错误的BUG,是因为换行符导致的图片标签错误,具体如下:
出错的代码在_own.py文件的24行
self.labels = [{c.split(' ')[0]: c.split(' ')[-1][:-1]} for c in file.readlines()]
你好,在使用本工程的代码时发现一个图片标签错误的BUG,是因为换行符导致的图片标签错误,具体如下:
出错的代码在_own.py文件的24行
self.labels = [{c.split(' ')[0]: c.split(' ')[-1][:-1]} for c in file.readlines()]
当用户的text.txt的最后一行是空白行时,得到的图片标签是“205341_02.PNG“:” JC1839”
text.txt文件的最后两行如下
205341_02.PNG JC1839 # 这是文件的倒数第二行
这是文件的最后一行,空白行
当用户的text.txt的最后一行不是空白行时,得到的图片标签是“205341_02.PNG“:” JC183”
205341_02.PNG JC1839 # 这是文件的最后一行
正确的应该是
self.labels = [{c.split(' ')[0]: c.split(' ')[-1].strip("\n")} for c in file.readlines()]
The text was updated successfully, but these errors were encountered: