当前位置:网站首页>【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即可
边栏推荐
- Industry-university-research application to build an open source talent ecosystem | 2022 Open Atom Global Open Source Summit Education Sub-Forum was successfully held
- Safety 20220715
- BP神经网络
- 三子棋的代码实现
- 产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开
- [AUTOSAR-RTE]-5-Explicit (explicit) and Implicit (implicit) Sender-Receiver communication
- volatile内存语义以及实现 -volatile写和读对普通变量的影响
- unity2d小游戏
- MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行
- 【论文阅读】Mastering the game of Go with deep neural networks and tree search
猜你喜欢

mysql基础知识(二)

Explanation of

扫雷游戏(c语言写)
![[Paper reading] Mastering the game of Go with deep neural networks and tree search](/img/4f/899da202e13bd561bbfdbaeebe4d2e.jpg)
[Paper reading] Mastering the game of Go with deep neural networks and tree search

Vue项目通过node连接MySQL数据库并实现增删改查操作

(5) final, abstract class, interface, inner class

MATLAB/Simulink & & STM32CubeMX tool chain completes model-based design development (MBD) (three)

idea工程明明有依赖但是文件就是显示没有,Cannot resolve symbol ‘XXX‘

BUG destroyer!!Practical debugging skills are super comprehensive

已解决(最新版selenium框架元素定位报错)NameError: name ‘By‘ is not defined
随机推荐
ENSP,划分VLAN、静态路由,三层交换机综合配置
Summary of Huawei Distributed Storage FusionStorage Knowledge Points [Interview]
How Zotero removes auto-generated tags
WeChat applet uses cloud functions to update and add cloud database nested array elements
Understanding of the presence of a large number of close_wait states
el-image标签绑定点击事件后没有有用
pom文件成橘红色未加载的解决方案
Win10 CUDA CUDNN installation configuration (torch paddlepaddle)
Gaussian distribution and its maximum likelihood estimation
qlib自动化quant
马斯克对话“虚拟版”马斯克,脑机交互技术离我们有多远
Basic knowledge of mysql (2)
Pytest e-commerce project combat (on)
open failed: EACCES (Permission denied)
Safety 20220718
prompt.ml/15中<svg>标签使用解释
递归实现汉诺塔问题
(Line segment tree) Summary of common problems of basic line segment tree
ClickHouse: Setting up remote connections
$parent/$children and ref