问题描述

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.
episode_classes_rel = self._rng.choice(self.span_leaves_rel)

在这里插入图片描述

用 Meta-Dataset 做训练,由于数据采样方式的问题导致 numpy array 的维度不一致,但不影响训练。

解决方法

在程序开头加上这句话,关掉 warning 即可:

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

解决方法来源:https://stackoverflow.com/questions/63097829/
在这里插入图片描述

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐