100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > 报错ValueError: operands could not be broadcast together with shapes (448 448) with (224 224)

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

时间:2022-07-20 03:32:37

相关推荐

报错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大小: 224w大小: 224mesh形状: (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)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。