当前位置:网站首页>【debug锦集】Expected input batch_size (1) to match target batch_size (0)
【debug锦集】Expected input batch_size (1) to match target batch_size (0)
2022-07-31 04:31:00 【雪天鱼】
我是雪天鱼,一名FPGA技术爱好者,B站账号:https://space.bilibili.com/397002941?spm_id_from=333.1007.0.0
(1)由于输入到 loss函数的label不满足要求格式导致
loss = criterion(output, label)
这里的label是tensor类型,元素个数要与种类个数对应,如四分类,则 label=[1,0,0,0]、[0,1,0,0]、[0,0,1,0]、[0,0,0,1] 这样 ,即与预测的输出是一个样子,size和dtype都要一致:
预测输出:
报错details:
解决方法:
手动调整下label即可
边栏推荐
- [shell basics] determine whether the directory is empty
- 开源汇智创未来 | 2022开放原子全球开源峰会OpenAtom openEuler分论坛圆满召开
- Safety 20220712
- 微软 AI 量化投资平台 Qlib 体验
- MySQL模糊查询可以使用INSTR替代LIKE
- Safety 20220715
- [Swift]自定义点击APP图标弹出的快捷方式
- C语言从入门到如土——数据的存储
- visual studio 那些提高效率的快捷键,总结(不时更新)
- "DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction" paper notes
猜你喜欢
两个地址池r2负责管地址池r1负责管dhcp中继
已解决(最新版selenium框架元素定位报错)NameError: name ‘By‘ is not defined
专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础
ENSP,划分VLAN、静态路由,三层交换机综合配置
"DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction" paper notes
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)
"A daily practice, happy water problem" 1331. Array serial number conversion
LocalDate addition and subtraction operations and comparison size
Thinking about data governance after Didi fines
ENSP, VLAN division, static routing, comprehensive configuration of Layer 3 switches
随机推荐
mysql基础知识(二)
专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础
Smartcom Programming Level 4 - Magic Academy Lesson 6
Vue项目通过node连接MySQL数据库并实现增删改查操作
visual studio 那些提高效率的快捷键,总结(不时更新)
Daily practice of LeetCode - 138. Copy a linked list with random pointers
(5) final, abstract class, interface, inner class
XSS shooting range (3) prompt to win
PCL 计算点云坐标最值及其索引
No qualifying bean of type question
The idea project obviously has dependencies, but the file is not displayed, Cannot resolve symbol 'XXX'
How Zotero removes auto-generated tags
Win10 CUDA CUDNN installation configuration (torch paddlepaddle)
Thinking about data governance after Didi fines
慧通编程第4关 - 魔法学院第6课
Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开
【SemiDrive源码分析】【MailBox核间通信】44 - 基于Mailbox IPCC RPC 实现核间通信(RTOS侧 IPCC_RPC Server 消息接收及回复 原理分析篇)
qlib架构
IDEA common shortcut keys and plug-ins