以上代码的详细debug过程,请参考我的这篇博客【Pytorch框架学习路径(七:数据读取机制DataLoader与Dataset)】,下面是博客链接:https://blog.csdn.net/weixin_54546190/article/details/125102260?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22125102260%22%2C%22source%22%3A%22weixin_54546190%22%7D&ctrtid=Lm451。