JavaShuo
栏目
标签
pytorch挖坑之:Expected object of scalar type Long but got scalar type Float for argument target...
时间 2020-12-24
标签
pytorch
python
深度学习
栏目
Scala
繁體版
原文
原文链接
目录 1. 问题分析 2. 总结 1. 问题分析 报错提示:需要Long类型的,但是收到了Float类型。 google了一下,都说是到相应的位置,后面加上.float()。 但是改了之后,还是不行,报了另外一个错误: 后来发现,应该是自己传的target有问题,也就是label。 查看了一下自己写的Dataset类,手动地把0变成[1, 0], 把1变成[0, 1], **其实根本不需要!!!不
>>阅读原文<<
相关文章
1.
RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target'
2.
RuntimeError: Expected object of scalar type Long
3.
RuntimeError:Expected object of scalar type Double
4.
pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long;
5.
使用nn.init自定义权重,总是报错RuntimeError: Expected object of scalar type Double but got scalar type Float for
6.
expected type torch.FloatTensor but got torch.cuda.FloatTensor
7.
解决PyTorch报错:RuntimeError: Expected object of backend CPU but got backend CUDA for argument #2 'other
8.
warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘time_t {aka long int}
9.
Expected mime type application/octet-stream but got text/html.
10.
warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__pid_t (*)(void)’
更多相关文章...
•
ASP Type 属性
-
ASP 教程
•
ASP Type 属性
-
ASP 教程
•
互联网组织的未来:剖析GitHub员工的任性之源
•
为了进字节跳动,我精选了29道Java经典算法题,带详细讲解
相关标签/搜索
scalar
type
for...of
for..of
type.2.3
quickupload&type
type='file'
type.3.2.2
argument
got
Scala
CSS
Python
MyBatis教程
MySQL教程
Hibernate教程
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
1.2 Illustrator多文档的几种排列方式
2.
5.16--java数据类型转换及杂记
3.
性能指标
4.
(1.2)工厂模式之工厂方法模式
5.
Java记录 -42- Java Collection
6.
Java记录 -42- Java Collection
7.
github使用
8.
Android学习笔记(五十):声明、请求和检查许可
9.
20180626
10.
服务扩容可能引入的负面问题及解决方法
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target'
2.
RuntimeError: Expected object of scalar type Long
3.
RuntimeError:Expected object of scalar type Double
4.
pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long;
5.
使用nn.init自定义权重,总是报错RuntimeError: Expected object of scalar type Double but got scalar type Float for
6.
expected type torch.FloatTensor but got torch.cuda.FloatTensor
7.
解决PyTorch报错:RuntimeError: Expected object of backend CPU but got backend CUDA for argument #2 'other
8.
warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘time_t {aka long int}
9.
Expected mime type application/octet-stream but got text/html.
10.
warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__pid_t (*)(void)’
>>更多相关文章<<