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.
js中 charCodeAt
2.
Android中通過ViewHelper.setTranslationY實現View移動控制(NineOldAndroids開源項目)
3.
【Android】日常記錄:BottomNavigationView自定義樣式,修改點擊後圖片
4.
maya 文件檢查 ui和數據分離 (一)
5.
eclipse 修改項目的jdk版本
6.
Android InputMethod設置
7.
Simulink中Bus Selector出現很多? ? ?
8.
【Openfire筆記】啓動Mac版Openfire時提示「系統偏好設置錯誤」
9.
AutoPLP在偏好標籤中的生產與應用
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)’
>>更多相關文章<<