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.
windows下配置opencv
2.
HED神經網
3.
win 10+ annaconda+opencv
4.
ORB-SLAM3系列-多地圖管理
5.
opencv報錯——(mtype == CV_8U || mtype == CV_8S)
6.
OpenCV計算機視覺學習(9)——圖像直方圖 & 直方圖均衡化
7.
【超詳細】深度學習原理與算法第1篇---前饋神經網絡,感知機,BP神經網絡
8.
Python數據預處理
9.
ArcGIS網絡概述
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)’
>>更多相關文章<<