码迷,mamicode.com
首页 > 其他好文 > 详细

numpy错误解决方案

时间:2021-02-03 10:42:18      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:pes   filter   ack   pytho   忽略   rom   tin   shape   function   

VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify ‘dtype=object’ when creating the ndarray
bboxes = np.array(bboxes)

在调用opencv一句简单代码时

while cv.waitKey(1) < 0:

出现以下错误

E:\Anaconda3\envs\labelimg\lib\site-packages\numpy\lib\function_base.py:793: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify ‘dtype=object‘ when creating the ndarray.
  return array(a, order=order, subok=subok, copy=True)

其实这不是错误,只是新版numpy的一个警告,可以忽略。当然总是显示影响美观,可以直接关闭该警告

np.warnings.filterwarnings(‘ignore‘, category=np.VisibleDeprecationWarning)

numpy错误解决方案

标签:pes   filter   ack   pytho   忽略   rom   tin   shape   function   

原文地址:https://www.cnblogs.com/MorganMa/p/14362063.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!