原文:Pytorch報錯:view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

參考文章: https: blog.csdn.net jorg zhao article details https: blog.csdn.net lhyyhlfornew article details ...

2021-07-14 16:23 0 152 推薦指數:

查看詳情

the size of tensor a (539) must match the size of tensor b (512) at non-singleton dimension 1

明明已經對超過512長度的序列做了處理,但這個怎么都處理不了,經過檢查發現在對子句之間添加[SEP]標記時,錯誤的將[SEP]寫成了[sep],致使電腦在識別的時候無法將[sep]識別出來,而是識別成了[ , s , e , p , ] 這幾個分開的,所以長度比正常的長而且代碼也無 ...

Sat Apr 09 18:51:00 CST 2022 3 1006
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM