报错ValueError: operands could not be broadcast together with shapes (448,448) with (224,224)
这个错误发生原因是因为图片的尺寸与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)相关推荐
- 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 ...
- 【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 ...
- 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, ...
- 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. __ ...
- import lap报错ValueError
import lap报错ValueError: numpy.ndarray has the wrong size, try recompiling. Expected 88, got 96 问题:首先 ...
- 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等数据 ...
- 【labelme】标注工具报错ValueError: min() arg is an empty sequence
[labelme]标注工具报错ValueError: min() arg is an empty sequence 今天在用labelme对图片进行标注时,点到某处突然卡了,随后labelme直接退出 ...
- Keras前后尺寸一致却依然报错'ValueError: total size of new array must be unchanged'的原因
某些情况下我们需要对张量进行维度变换,一般可以通过调用以下两种方法实现: # 1. TensorFlow自带 tf.reshape(tensor, target_shape) # 2. (推荐)Ker ...
- 使用stratifiedKFold进行分层交叉验证时候报错:ValueError: Supported target types are: ('binary', 'multiclass'). Got
ValueError Traceback (most recent call last) <ipython-input-42-2ab744268d80> in <module> ...
最新文章
- 面试官:如果让你设计一个消息中间件,如何将其网络通信性能优化10倍以上?【石杉的架构笔记】...
- iOS网络编程之Socket
- 如何评审功能测试用例?
- 数据结构与算法-- 二叉树中和为某一值的路径
- c++基础学习(06)--(时间,输入输出,数据结构)
- fcc无线充电认证_FCC规定了无线路由器固件,轮椅和胰岛素的开放状态以及更多新闻
- 我的css家园博客开通了
- linux系统win,Windows10安装运行linux系统的方法
- L1-080 乘法口诀数列 (20 分)-PAT 团体程序设计天梯赛 GPLT
- 深入一点 让细节帮你和Fragment更熟络
- 【Hibernate3.3复习知识点一】 - 配置hibernate环境(XML)。
- RDKit|使用MolDraw2DCairo模块绘制分子
- QTableView固定行显示的问题
- android Gmail查看图片时选择经信息(彩信)分享,手机报错或手机报错后又回到查看图片界面
- 简历学习课程:1-9课
- 播布客教学视频_C学习笔记_9.1_整形转字符串
- 设置操作系统(win10)的环境变量以便从cmd直接进入Python
- 知识图谱辅助的个性化推荐系统
- 【PTA】到底是不是太胖了
- 通过PS把月亮装进灯泡里打造创意灯泡月亮