invalid argument 5: k not in range for dimension at /opt/conda/conda-bld/pytorch_1607370172916/work/aten/src/THC/generic/THCTensorTopK.cu:26
2023-09-11 14:22:51 时间
报错原因:我训练的模型是二分类,所以根本没有五个类
torch.topk(input, k, dim=None, largest=True, sorted=True, out=None) -> (Tensor, LongTensor)
input:一个tensor数据
k:指明是得到前k个数据以及其index
dim: 指定在哪个维度上排序, 默认是最后一个维度
largest:如果为True,按照大到小排序; 如果为False,按照小到大排序
sorted:返回的结果按照顺序返回
out:可缺省,不要
相关文章
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd3 in position 5: invalid continuation byte
- Linux C 错误 invalid application of ‘sizeof‘ to incomplete type 解决方案
- Android Integer.parseInt java.lang.NumberFormatException: Invalid int解决方法
- 二则 ORA-01722: invalid number错误的处理,substr to_char之间的区别。连接符号错误 + ||
- mysql报错ERROR 1356 (HY000): View ‘mysql.user‘ references invalid table(s) or column(s) or function(s)
- Mysql 报错:#1067 - Invalid default value for 'update_time
- MSB6001:Invalid command line switch for CL.exe
- Tomcat_启动多个tomcat时,会报StandardServer.await: Invalid command '' received错误
- Google Chrome 错误代码“STATUS_INVALID_IMAGE_HASH”
- [WARNING] The POM for com.tenyears:base-common:jar:1.0 is invalid, transitive dependen
- Installing Windows Identity Foundation on Windows 8 - The Certificate for the signer of the message is invalid or not found.