VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tupl

本文介绍了解决numpy中VisibleDeprecationWarning警告的方法,包括更新版本和指定dtype=object参数,帮助读者理解并避免在创建不规则数组时出现警告。

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.

这是因为新的numpy版本,将 创建不同长度或形状的列表或元组或ndarray的列表或ndarray元组的功能 会被弃用,虽然能够运行,但是总提示Warning还是很不舒服,况且之后也不能这样用了。

简而言之就是,array的各列或者各行的维度不同……
比如第一行有5个,第二行是4个这样……

解决办法:
方法一:使用更早的numpy版本
方法二:加上’dtype=object’

bboxes = np.array(test_list,dtype=object)

参考链接:
https://blog.csdn.net/qq_41917697/article/details/115698304

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值