项目场景:

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. 关于python的打包打包完生成exe文件之后,不能正常执行程序的问题解决。
  2. 通过SQL Server 2008 访问MySQL
  3. 【机器学习】深刻理解决策树-动手计算ID3算法
  4. 1.网络工具:ifconfig,ping,netstate,Redhat命令和图形化设置ip,finger,nslookup
  5. 高光谱图像pca降维_高光谱图像的数据特性之探讨
  6. gson解析php,php,android_关于 Gson 解析JSON数据。。。,php,android - phpStudy
  7. Kafka消息压缩与解压
  8. 英伟达2022财年第二季度获得创纪录营收65.1亿美元
  9. vue element-ui NavMenu错位问题
  10. 如何按关键字搜索商品详情
  11. 什么软件能测试电脑能不能玩lol,怎么测试自己电脑能不能玩英雄联盟
  12. c#中计算三角形面积公式_高中数学|向量公式之用平面向量求三角形面积
  13. 个人支付方案(免签约)-支付宝当面付开通教程
  14. 【Maxent物种分布模型】气候变化对响尾蛇地理分布的影响
  15. 考研报名时,需要准备哪些信息?
  16. 用Python画环环相扣的奥运五环
  17. 前端开发:使用HTML5简单实现嫦娥奔月动画
  18. Taro 兼容 h5 踩坑指南
  19. 使用click创建完美的Python命令行程序
  20. C++ Primer 第六章—— 函数 思维导图

热门文章

  1. Lightbox JS 用法
  2. 服务器装系统报0x0000005d,安装Win8系统提示Error Code:0x0000005D错误怎么办
  3. macd金叉股共振_股票MACD金叉什么意思
  4. 大数据经典书籍良心推荐
  5. H5中的video标签使用
  6. php批量发邮件,使用phpmailer发送批量邮件
  7. 【Codecs系列】X265编码器(六):lookahead模块分析
  8. linux常用cat,Linux常用操作命令之cat
  9. GEO数据挖掘(学习笔记)
  10. 阵列卡直通模式和raid模式_详解磁盘阵列RAID原理、种类及性能优缺点