解决ret = umr

解决ret = umr,第1张

解决ret = umr 项目场景

numpy np.mean()计算平均值

问题描述

完整报错如下:

Traceback (most recent call last):
  File "test_wq.py", line 88, in 
    valid_cls(model, im_test_data, sk_test_data)
  File "test_wq.py", line 54, in valid_cls
    avg = np.mean(presicion_array)
  File "<__array_function__ internals>", line 6, in mean
  File "/root/anaconda3/envs/dpm-pc-gen/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 3373, in mean
    out=out, **kwargs)
  File "/root/anaconda3/envs/dpm-pc-gen/lib/python3.7/site-packages/numpy/core/_methods.py", line 160, in _mean
    ret = umr_sum(arr, axis, dtype, out, keepdims)
RuntimeError: The size of tensor a (400) must match the size of tensor b (20) at non-singleton dimension 0
原因分析

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5670243.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存