报错FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecate;
FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecate;的解决办法

解决办法

1.升级numpy的版本

pip uninstall numpy
pip install numpy==1.16.4

2.将报错的部分修改

若升级numpy的版本无效,则将将np.dtype([("quint8", np.uint8, 1)])
修改为np.dtype([("quint8", np.uint8, (1,))]),建议用修改后的写法

np.dtype([("quint8", np.uint8, (1,))])

我一开始试过第一种方法,一开始是可以解决这个报错的,但有一次在别的电脑也尝试第一种方法的时候,解决不了,然后我将np.dtype([("quint8", np.uint8, 1)])修改为np.dtype([("quint8", np.uint8, (1,))])后,发现这个报错解决了。两种方法都可以尝试一下。

相关文章:

  • 2022-01-10
  • 2021-12-30
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2021-09-12
猜你喜欢
  • 2022-12-23
  • 2021-07-08
  • 2022-01-06
相关资源
相似解决方案