在复刻Mask R-CNN训练自己的数据集进行测试时遇到这个问题,测试代码是在别人代码基础上进行修改的,一开始以为是维数没有对应好,仔细检查后发现并无问题,于是将问题转移到目标图片上,在确认图片为RGB格式后,将问题锁定在读入上,最终查找资料解决问题。

解决方法

 将Image= skimage.io.imread(file_name) 改为 image = cv2.imread(file_name)

skimage.io.imread与cv2.imread保存后都是numpy格式,但cv2的储存格式是BGR,而skimage的储存格式为RGB。这是一个历史遗留问题,当年使用硬件平台的前辈们用的是BGR,然后opencv也跟着当年的习惯再走。奇怪的是使用官方的图片不会报错,而使用自己的图片却会出现问题:(

ValueError: operands could not be broadcast together with remapped shapes 解决方法相关推荐

  1. operands could not be broadcast together with remapped shapes

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

  2. 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 ...

  3. 【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 ...

  4. 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, ...

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

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

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

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

  7. ValueError: check_hostname requires server_hostname解决方法

    使用python的pip安装第三方包的时候会出现这个问题 查看了一些解决方法 关掉一些代理VPN然后重试,再不行就关闭计算机代理: PS H:\python_project\Python-Multip ...

  8. python彩色图像如何进行高斯滤波ValueError: correlate2d inputs must both be 2-D arrays解决方法

    文章目录 遇到的问题 解决方法 参考 遇到的问题 在执行高斯滤波的代码时,遇到下列问题 ValueError: correlate2d inputs must both be 2-D arrays 进 ...

  9. tensorboard报错:ValueError Duplicate plugins for name projector 问题的出现及解决过程

    tensorboard报错:ValueError: Duplicate plugins for name projector 问题的出现及解决过程 记录如题问题的出现及解决过程. 报错命令及信息 笔者 ...

  10. Python Keras ValueError: Layer sequential expects 1 input(s), but it received 2 input tensors. 解决方法

    在fashion_mnist的学习中遇到这样一个问题,代码如下: from tensorflow.keras import Sequential from tensorflow.keras.layer ...

最新文章

  1. vue中子组件和子组件之间怎么通信_vue.js组件之间如何通信?
  2. 微软张若非:搜索引擎和广告系统,那些你所不知的AI落地技术
  3. 计算机题windows如何操作,2015年职称计算机Windows操作系统模拟题(二)
  4. 黑马程序员-面向对象-06天-3(static-静态代码块)
  5. 三级数据库还是linux好,08年计算机三级数据库辅导:如何修改Linux下MySQL5.0的默认连接数...
  6. POJ 1200 Crazy Search(RK)
  7. 小程序webview不全屏_小程序不在小(深度)
  8. (13)Verilog程序结构-基本语法(一)(第3天)
  9. 中兴首款5G旗舰手机来了:2月25日见!
  10. 虚拟主机网络设备iotlb
  11. Mac 终端 显示隐藏文件
  12. windows加密和linux加密_Windows系统自带的BitLocker加密方法
  13. 【Qt教程】1.10 - Qt5模态与非模态对话框( QDialog)
  14. 你焊接过最小的贴片器件是多大?
  15. c语言读取三菱plc数据,c#通过网线读取三菱PLC数据
  16. 构造函数,静态关键字,静态代码块,构造代码块,局部代码块
  17. 如何系统的学习 Elasticsearch ?
  18. 文件管理(文件系统)
  19. 金融产品的不可能三角:收益性、风险性、流动性
  20. 周鸿祎给360员工的一份信:不做打工者

热门文章

  1. flutter 报错 type ‘int‘ is not a subtype of type ‘String‘ 奇葩经历
  2. 更改项目名后出现Could not resolve type id ** into a subtype的报错
  3. A N S I五个预定义的宏名
  4. 前端微服务框架single-spa
  5. gnu coreutils4.5.1 hostid.c源码解读
  6. css背景随机,CSS如何随机定义网页中的背景颜色
  7. linux teamviewer升级,在CentOS 8系统上自动更新TeamViewer的方法
  8. 新人服务器上快速简单搭建cs
  9. LabVIEW的编程-程序框图入门笔记
  10. LQR,iLQR,DDP控制论经典算法(MBRL基础知识)