1.FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
网上找资料的过程中,发现两种方法,一种是降低numpy版本,但是具体降低到多少不知道,于是借鉴另一种方法 点进出现的警告,进入dtypes.py,修改对应行的代码,例如把np.dtype([(“quint8”, np.uint8, 1)])修改为np.dtype([(“quint8”, np.uint8, (1,))]),但是还是没解决
原文链接:https://blog.csdn.net/BigDream123/article/details/99467316
于是采用网上另一种方法,降低numpy的版本,当前版本是1.19.5,打算先试试1.16版本的numpy
首先卸载当前版本
pip uninstall numpy
安装numpy1.16
pip install numpy==1.16.0
问题解决
第二次碰到,用了第一个方法解决了!
2.用tensoeflow2跑1的代码
import tensorflow.compat.v1 as tf #使用1版本
tf.disable_v2_behavior() #禁用2版本
替换import tensorflow as tf
3.没有名称为 ‘cv2’ 的模块
直接pip install opencv-python就好