logo
Loading...

出現RuntimeError: Expected object of device type cuda but got device type cpu for argument #2 'other' in call to _th_min錯誤 - Cupoy

1.把Build SSD_VGG.ipynb 的 Use_cuda = True後,程式跑到 los...

出現RuntimeError: Expected object of device type cuda but got device type cpu for argument #2 'other' in call to _th_min錯誤

2020/01/06 04:01 PM
電腦視覺深度學習論壇
胡連福
觀看數:0
回答數:1
收藏數:1

1.把Build SSD_VGG.ipynb 的 Use_cuda = True後,程式跑到 loss_l,loss_c = criterion(out,y ) 時,

出現 RuntimeError: Expected object of device type cuda but got device type cpu for argument #2 'other' in call to _th_min

2.我確認 torch.cuda.is_available() 是返回 True,請問這是哪裡有問題 ? 還要做哪些 check 動作 ?

===========================================

RuntimeError                              Traceback (most recent call last)
<ipython-input-15-de7e25ab935e> in <module>
    18         out = net(image_)
    19         '''Regression Loss and Classification Loss'''
---> 20         loss_l,loss_c = criterion(out,y )

      

RuntimeError: Expected object of device type cuda but got device type cpu for argument #2 'other' in call to _th_min