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.
CVPR 2020 論文大盤點-光流篇
2.
Photoshop教程_ps中怎麼載入圖案?PS圖案如何導入?
3.
org.pentaho.di.core.exception.KettleDatabaseException:Error occurred while trying to connect to the
4.
SonarQube Scanner execution execution Error --- Failed to upload report - 500: An error has occurred
5.
idea 導入源碼包
6.
python學習 day2——基礎學習
7.
3D將是頁遊市場新賽道?
8.
osg--交互
9.
OSG-交互
10.
Idea、spring boot 圖片(pgn顯示、jpg不顯示)解決方案
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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)’
>>更多相關文章<<