当前位置:网站首页>自定义训练,使用Generator dataset迭代数据报错
自定义训练,使用Generator dataset迭代数据报错
2022-08-10 03:28:00 【小乐快乐】
mindspore 1.3 Ascend 910环境
因为任务要求,我没有使用高层的model.train()接口,而是自定义训练过程,像pytorch那样训练,使用Generator Dataset迭代数据,第一个epoch数据正常迭代,下一个epoch就会报错。在每个epoch迭代之后,我都对dataset进行了reset,是不是我reset的位置不对或是少了什么东西?
报错的截图:

根据报错的信息,你自定义的dataset 的 __len__ 函数返回值是 36,但是真实的 __next__ 返回的数据量只有35 条,这个校验错误,所以报错了。
快速验证的话,你可以把 __len__的返回值改成 35 再试下。
边栏推荐
猜你喜欢
随机推荐
Did not detect default resource location for test class xxxx
Difference between netstat and ss command
10个超赞的C语言开源项目,值得学习
The so-called software testing ability is actually these 5 points
国能准能集团研发矿山数字孪生系统 填补国内采矿行业空白
TCP协议之《ACK状态4种详解》
获取属性特性几种方法
如何整合全流程数据,全面提升研发效能?|2分钟了解 ONES
How does a new tester do functional testing?Test thinking is really important
ES高亮显示语法
c语言进阶篇:动态内存管理(相关函数、常见错误、笔试题)
Camera partial update
文件操作【c语言】
TCP协议之《Out-Of-Window报文限速》
How to quickly become a software test engineer?What skills do testers need for a monthly salary of 15k?
Evaluation and Construction of Enterprise Network Security Capability from the Sliding Ruler Model
Dijkstra求最短路
如何快速成为一名软件测试工程师?测试员月薪15k需要什么技术?
RoyalScope分析仪:发现CAN总线波形台阶和信号幅值低的问题
vue项目 npm run build 打包项目防止浏览器缓存









