JavaShuo
栏目
标签
RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target'
时间 2020-12-24
栏目
Scala
繁體版
原文
原文链接
在用pytorch进行深度神经网络训练时,出现以下问题,特做记录 这个错误是说需要的数据类型是long而我的数据类型是float,所以需要进行数据类型转化 在pytorch中数据转化有专属自己的用法,即data=data.long() 所以在代码中做了如下修改: cond_op_truth_var = cond_op_truth_var.long() 问题解决
>>阅读原文<<
相关文章
1.
pytorch挖坑之:Expected object of scalar type Long but got scalar type Float for argument target...
2.
RuntimeError: Expected object of scalar type Long
3.
使用nn.init自定义权重,总是报错RuntimeError: Expected object of scalar type Double but got scalar type Float for
4.
RuntimeError:Expected object of scalar type Double
5.
pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long;
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 教程
•
为了进字节跳动,我精选了29道Java经典算法题,带详细讲解
•
RxJava操作符(六)Utility
相关标签/搜索
scalar
type
for...of
for..of
type.2.3
quickupload&type
type='file'
type.3.2.2
runtimeerror
argument
Scala
CSS
MyBatis教程
PHP 7 新特性
Spring教程
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
vs2019运行opencv图片显示代码时,窗口乱码
2.
app自动化 - 元素定位不到?别慌,看完你就能解决
3.
在Win8下用cisco ××× Client连接时报Reason 422错误的解决方法
4.
eclipse快速补全代码
5.
Eclipse中Java/Html/Css/Jsp/JavaScript等代码的格式化
6.
idea+spring boot +mabitys(wanglezapin)+mysql (1)
7.
勒索病毒发生变种 新文件名将带有“.UIWIX”后缀
8.
【原创】Python 源文件编码解读
9.
iOS9企业部署分发问题深入了解与解决
10.
安装pytorch报错CondaHTTPError:******
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
pytorch挖坑之:Expected object of scalar type Long but got scalar type Float for argument target...
2.
RuntimeError: Expected object of scalar type Long
3.
使用nn.init自定义权重,总是报错RuntimeError: Expected object of scalar type Double but got scalar type Float for
4.
RuntimeError:Expected object of scalar type Double
5.
pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long;
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)’
>>更多相关文章<<