这个错误发生原因是因为图片的尺寸与weight 不匹配,不能做乘积,所以需要改变图片尺寸。

使用如下代码:img = cv2.resize(img, (448, 448))

加在img = cv2.resize(img, (448, 448)) img = cv2.cvtColor(img, cv2.COLOR_RGB2RGBA) x_offset = y_offset = 0 y1, y2 = y_offset, y_offset + image.shape[0] x1, x2 = x_offset, x_offset + image.shape[1]
这里

类似错误:

h大小: 224
w大小: 224
mesh形状: (448, 448)
image形状: (448, 448)
image大小: (448, 448, 4)
img大小: (224, 224, 4)
Traceback (most recent call last):File "trimesh_renderer.py", line 124, in <module>visualize(renderer, original_img, params, vertices, cam, joints)File "/Users/elaine/Desktop/hmr2/src/notebooks/vis_util.py", line 162, in visualizeimg_overlay = renderer(vert_shifted, img=img, bg_color=np.array((255.0, 255.0, 255.0, 1)))File "trimesh_renderer.py", line 63, in __call__img[y1:y2, x1:x2, c] = (alpha_mesh * image[:, :, c] + alpha_image,img[y1:y2, x1:x2, c])
ValueError: could not broadcast input array from shape (2) into shape (224,224)

报错ValueError: operands could not be broadcast together with shapes (448,448) with (224,224)相关推荐

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

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

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

  4. Django报错 ValueError: The view didn‘t return an HttpResponse object. It returned None instead.

    Django报错 ValueError: The view *** didn't return an HttpResponse object. It returned None instead. __ ...

  5. import lap报错ValueError

    import lap报错ValueError: numpy.ndarray has the wrong size, try recompiling. Expected 88, got 96 问题:首先 ...

  6. Python中调用FRED报错ValueError: time data 'fred' does not match format '%Y-%m-%d'

    Python中调用FRED报错ValueError: time data 'fred' does not match format '%Y-%m-%d' 小白一枚,刚学习python调用FRED等数据 ...

  7. 【labelme】标注工具报错ValueError: min() arg is an empty sequence

    [labelme]标注工具报错ValueError: min() arg is an empty sequence 今天在用labelme对图片进行标注时,点到某处突然卡了,随后labelme直接退出 ...

  8. Keras前后尺寸一致却依然报错'ValueError: total size of new array must be unchanged'的原因

    某些情况下我们需要对张量进行维度变换,一般可以通过调用以下两种方法实现: # 1. TensorFlow自带 tf.reshape(tensor, target_shape) # 2. (推荐)Ker ...

  9. 使用stratifiedKFold进行分层交叉验证时候报错:ValueError: Supported target types are: ('binary', 'multiclass'). Got

    ValueError Traceback (most recent call last) <ipython-input-42-2ab744268d80> in <module> ...

最新文章

  1. 面试官:如果让你设计一个消息中间件,如何将其网络通信性能优化10倍以上?【石杉的架构笔记】...
  2. iOS网络编程之Socket
  3. 如何评审功能测试用例?
  4. 数据结构与算法-- 二叉树中和为某一值的路径
  5. c++基础学习(06)--(时间,输入输出,数据结构)
  6. fcc无线充电认证_FCC规定了无线路由器固件,轮椅和胰岛素的开放状态以及更多新闻
  7. 我的css家园博客开通了
  8. linux系统win,Windows10安装运行linux系统的方法
  9. L1-080 乘法口诀数列 (20 分)-PAT 团体程序设计天梯赛 GPLT
  10. 深入一点 让细节帮你和Fragment更熟络
  11. 【Hibernate3.3复习知识点一】 - 配置hibernate环境(XML)。
  12. RDKit|使用MolDraw2DCairo模块绘制分子
  13. QTableView固定行显示的问题
  14. android Gmail查看图片时选择经信息(彩信)分享,手机报错或手机报错后又回到查看图片界面
  15. 简历学习课程:1-9课
  16. 播布客教学视频_C学习笔记_9.1_整形转字符串
  17. 设置操作系统(win10)的环境变量以便从cmd直接进入Python
  18. 知识图谱辅助的个性化推荐系统
  19. 【PTA】到底是不是太胖了
  20. 通过PS把月亮装进灯泡里打造创意灯泡月亮

热门文章

  1. CTF隐写(stegsolve)
  2. [Signal]软阈值与硬阈值
  3. sql数据库如何读取数据
  4. 使用Java完成网上支付(1. 银联)
  5. MySQLdb 使用简介
  6. 金融分析:图形可视化plotly绘图思路—多子图教程
  7. springboot集成MQTT协议实现消息实时推送(未实现版)
  8. 官方:最好的版本!Python 3.11正式版来了!
  9. selenium+python安装教程
  10. 健康管理系统第六天(移动端开发之体检预约_经典五表联查_调用阿里云提供的短信服务进行短信验证码发送)