赞
踩
1.Bug解决-RuntimeError: Sizes of tensors must match except in dimension 2. Got 320 and 160 (The offendin_NANCYGOODENOUGH的博客-CSDN博客具体来说,就是将原来一个低分辨的像素划分为rr个更小的格子,利用rr个特征图对应位置的值按照一定的规则来填充这些小格子。C=torch.cat((A,B),0)就表示按维数0(行)拼接A和B,也就是竖着拼接,A上B下。C=torch.cat((A,B),1)就表示按维数1(列)拼接A和B,也就是横着拼接,A左B右。.cat是将两个张量(tensor)拼接在一起,cat是concatnate的意思,即拼接,联系在一起。是其属性,而size()是其继承的方法,两者均可以获得tensor的维度。...https://blog.csdn.net/qq_40723205/article/details/125905539?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522168430646016800213076896%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=168430646016800213076896&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-1-125905539-null-null.142%5Ev87%5Einsert_down1,239%5Ev2%5Einsert_chatgpt&utm_term=RuntimeError%3A%20torch.cat%28%29%3A%20Sizes%20of%20tensors%20must%20match%20except%20in%20dimension%201.%20Got%2048%20and%2016%20in%20dimension%200%20%28The%20offending%20index%20is%203%29&spm=1018.2226.3001.4187