较全面的博客:
https://blog.csdn.net/c2250645962/article/details/104869015
TypeError: ‘NoneType’ object is not subscriptable. 解决
原因:数据导入时少给了数据的标签,导致数据没有标签。
解决办法:1.移除没有标签的图像或给图像加上标签。
2.将datasets.py中的
if self.augment:
改为:
if self.augment and targets is not None: