TypeError: max() received an invalid combination of arguments - got (axis=int, out=NoneType, ), but expected one of:


TypeError: max() received an invalid combination of arguments - got (axis=int, out=NoneType, ), but expected one of:
 * ()
 * (Tensor other)
 * (int dim, bool keepdim)
      didn't match because some of the keywords were incorrect: axis, out
 * (name dim, bool keepdim)
      didn't match because some of the keywords were incorrect: axis, out

 使用max函數出現報錯

報錯語句為

np.max(M, axis=0).reshape((-1, 1))

M=

tensor([[3.5500, 2.8013, 1.1312],
        [2.8497, 2.3735, 1.3523],
        [1.3359, 0.7867, 0.0713]])
改為


np.max(M.numpy(), axis=0).reshape((-1, 1))


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM