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.
「插件」Runner更新Pro版,幫助設計師遠離996
2.
錯誤 707 Could not load file or assembly ‘Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKe
3.
Jenkins 2018 報告速覽,Kubernetes使用率躍升235%!
4.
TVI-Android技術篇之註解Annotation
5.
android studio啓動項目
6.
Android的ADIL
7.
Android卡頓的檢測及優化方法彙總(線下+線上)
8.
登錄註冊的業務邏輯流程梳理
9.
NDK(1)創建自己的C/C++文件
10.
小菜的系統框架界面設計-你的評估是我的決策
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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)’
>>更多相關文章<<