【报错处理】RuntimeError: input.size(-1) must be equal to input_size. Expected 5, got 21
1、原因: 使用view时维度指定错误,LSTM(input,(h0,c0)) 指定batch_first=True后,input就是(batch_size,seq_len,input_size)否则为input(seq_len, batch, input_size)
lstm_out, self.hidden = self.lstm(embeds.view(self.batch_size, 200, EMBEDDING_DIM), self.hidden)
2、原因:并不是rnn的错误,而是因为下一函数的输入和这一层输出维度不一样,对照维度信息和尺寸信息修改即可。
推荐报错解决方案:使用pytorch时遇到的问题汇总_vivian_ll的博客-CSDN博客
【报错处理】RuntimeError: input.size(-1) must be equal to input_size. Expected 5, got 21相关推荐
- 报错:RuntimeError: view size is not compatible with input tensor‘s size and stride (at least one dimen
报错:RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimen ...
- 报错解决——RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton
问题描述 RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dim ...
- pytorch 1.9.0 backward函数解释以及报错(RuntimeError: grad can be implicitly created only for scalar outputs)
文章目录 官方文档 简单示例 示例1 示例2(报错(RuntimeError: grad can be implicitly created only for scalar outputs)解决方法) ...
- 【kafka】kafka 启动报错 InvalidReceiveException: Invalid receive (size = -720899)
1.概述 kafka启动报错InvalidReceiveException: Invalid receive (size = -720899) 参考文章:https://bbs.csdn.net/to ...
- Python报错: RuntimeError: The current Numpy installation (‘D:\\Develop\\anaconda\\lib\\site-packages\\
Python报错: RuntimeError: The current Numpy installation ('D:\Develop\anaconda\lib\site-packages\numpy ...
- Pycharm 转化ui文件为py文件:报错Error in input file: not well-formed (invalid token): line 1, column 1
利用PyUIC转化 .ui文件为 .py文件时,报错 Error in input file: not well-formed (invalid token): line 1, column 1 我出 ...
- 使用fswebcam报错Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy或者使用metion监控,画面为灰色
一,BUG解决 不知道大家使用树莓派的时候,有没有遇到过使用fswebcam报错Error selecting input 0 VIDIOC_S_INPUT: Device or resource b ...
- python 运行画图时,报错:“RuntimeError: Invalid DISPLAY variable“
python 运行画图时,报错:"RuntimeError: Invalid DISPLAY variable" 错误描述 错误原因 matplotlib的默认backend是Tk ...
- Python 使用numpy报错:runtimeError: package fails to pass a sanity check解决方法
Python中使用numpy和pandas时报错:RuntimeError: The current Numpy installation ('...\venv\lib\site-packages\n ...
最新文章
- 使用 SqlHelperParameterCache 类管理参数
- Spring-AOP的实现方法
- Windows批量添加防火墙例外端口
- 导出txt文件宏_利用solidwords二次开发导出三维曲面方阵点坐标方法
- python 类-Python 变量类型
- json数据解析详解---代码每行进行分析
- 【电商福利】双十二优惠福利专场
- 【杂谈】当前模型量化有哪些可用的开源工具?
- 《Python Cookbook 3rd》笔记(2.15):字符串中插入变量
- python找出录取率最高的年份_Python分析42年高考数据,告诉你高考为什么这么难?...
- Python 之 eval 函数
- 20145122 《Java程序设计》第5周学习总结
- 关于win10家庭版不能开启虚拟机的问题
- 水系图一般在哪里找得到_水系电池再发Nature,事实力证将迎来发展的春天!
- 【理论】浅解硬件网络通信+交换机芯片+通信系统设计
- 使用Nssm部署Exe程序为服务
- Mann-Whitney 统计量
- 常用工具软件-官网下载地址
- IAR 的一个警告546
- Html-网页调用摄像头并拍照效果