ZBLOG

self.memory_data[t] = torch.cat((self.memory_data[t].cuda(),masked_x),0) # 将当前mini-batch的masked_x合并到memory_data[t] RuntimeError: The expanded size of the tensor (10) must match the existing size (20) at non-singleton dimension 0. Target sizes: ...

This error message indicates that there is a size mismatch when trying to concatenate two tensors. Specifically, the target size is [10, 3072], but the tensor sizes are [20, 3072]. This suggests that the dimensions of the two tensors being concatenated do not match.

To fix this issue, you may need to check the shape of the tensors and ensure that they have compatible dimensions before concatenating them. One approach could be to resize one or both tensors to match the desired target size before concatenating them. Another approach could be to modify the code that generates these tensors so that they have matching shapes from the start.

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=5222

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?