项目场景:

multihead-attention训练

out = torch.einsum('b h d e, b h d n -> b h e n', context, q)File "/root/anaconda3/lib/python3.7/site-packages/torch/functional.py", line 327, in einsumreturn _VF.einsum(equation, operands)  # type: ignore[attr-defined]
RuntimeError: einsum(): operands do not broadcast with remapped shapes [original->remapped]: [3, 4, 32, 32]->[3, 4, 32, 1, 32] [2, 4, 32, 65536]->[2, 4, 1, 65536, 32]

问题描述

完整报错:

Traceback (most recent call last):File "multi_train.py", line 38, in <module>trainer.train()File "/root/sketchMultimodal/denoising-diffusion-pytorch-master/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py", line 661, in trainall_images_list = list(map(lambda n: self.ema_model.sample(condition=data_c, batch_size=n), batches))File "/root/sketc

RuntimeError: einsum(): operands do not broadcast with remapped shapes [original->remapped]相关推荐

  1. einsum() operands do not broadcast with remapped shapes [original->remapped]报错解决方法

    RuntimeError: einsum() operands do not broadcast with remapped shapes [original->remapped]: [4, 6 ...

  2. operands could not be broadcast together with remapped shapes

    operands could not be broadcast together with remapped shapes 报错代码: point_num = 12try:labels=np.pad( ...

  3. ValueError: operands could not be broadcast together with shapes解决

    ValueError: operands could not be broadcast together with shapes (1,2) (1,3) import numpy as np a=np ...

  4. 【python问题系列--4】ValueError: operands could not be broadcast together with shapes (100,3) (3,1)...

    背景:dataMatrix是(100,3)的列表,labelMat是(1,100)的列表,weights是(3,1)的数组,属性如下代码所示: >>> import types &g ...

  5. ValueError: operands could not be broadcast together with shapes (320,320,4) (3,) (320,320,4)

    problem: ValueError: operands could not be broadcast together with shapes (320,320,4) (3,) (320,320, ...

  6. 成功解决IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (100,)

    成功解决IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (100,) 目 ...

  7. 报错ValueError: operands could not be broadcast together with shapes (448,448) with (224,224)

    这个错误发生原因是因为图片的尺寸与weight 不匹配,不能做乘积,所以需要改变图片尺寸. 使用如下代码:img = cv2.resize(img, (448, 448)) 加在img = cv2.r ...

  8. gcc报invalid operands of types ‘<unresolved overloaded function type>‘ and ‘int‘ to binary ‘operator<

    会报这个错,基本上就是这么个情况. object->function<var>(par,par); 这么用的时候gcc把<var>这个尖括号的左边识别成了小于号. 解决也 ...

  9. 一文掌握爱因斯坦求和约定 einsum

    爱因斯坦跟 NumPy 有关系吗?没有,但他提出了一个针对数学公式的符号简化办法,即爱因斯坦求和约定(Einstein Summation Convention)或者叫爱因斯坦标记法(Einstein ...

  10. 【Python学习记录】Numpy广播机制(broadcast)

    ✨ 博客主页:小小马车夫的主页 ✨ 所属专栏:Python学习记录 文章目录 一.什么是Numpy广播机制 二.Numpy广播应用 三.Numpy广播规则 一.什么是Numpy广播机制 在Numpy. ...

最新文章

  1. pytorch 动态调整学习率 重点
  2. java代码使用http请求解压zip包并解析xml_Javascript 是如何解析 Excel 文件的?
  3. 2013年十大IT发展趋势预测
  4. 4G EPS 中的 FDD/TDD 无线帧
  5. python语言模型工具_Python工具整合,为程序员和新手准备的 8 大 Python 工具
  6. C#——实现IComparableT 接口,ArrayLIst调用ArrayLIst.Sort()抛出System.InvalidOperationException异常解决方案
  7. 【数论】[CF258C]Little elephant and LCM
  8. 【万字干货】OpenMetric与时序数据库存储模型分析
  9. 错误记录 MongoClient opened before fork. Create MongoClient
  10. android的ListView做表格添加圆角边框
  11. Redis在CentOS 7上的安装部署
  12. iOS上传应用到AppStore出现Authenticating with the iTunes store
  13. 【免积分下载】吴恩达 机器学习笔记PDF版v5.5.pdf
  14. IntelliJ IDEA 社区版使用指南
  15. 数字黑洞java,java解决数字黑洞问题
  16. win7计算机ip地址怎么查,win7电脑的IP地址怎样查看
  17. (转载)七剑下天山,独领自动化测试技术
  18. 人脸识别智能服务器,智能化人脸识别服务器
  19. Restormer: Efficient Transformer for High-Resolution Image Restoration
  20. python相对于其他语言的优点

热门文章

  1. 闲时整理(5)--圆形标签
  2. SecKill——一款超级好用的抢单软件
  3. Cfree-5各种抽风解决办法
  4. Python——批量发送邮件(持续更新)
  5. genymotion配置android模拟器
  6. mysql数据类型内存_MySQL数据库基本功-常用数据类型介绍和优化技巧
  7. 13.包装类和字符串
  8. 民工哥读者中秋福利!包邮送书!
  9. 光模块有什么用?什么是SFP光模块?
  10. opencv实现图像平移