FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated解决办法
2020-04-24 11:02
701 查看
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’.
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping from keras.utils import np_utils from keras.optimizers import Adam from model.VGG16 import VGG16 import numpy as np import utils import cv2 from keras import backend as K
在用VGG分类模型训练自己的数据时,运行以上代码块时出现了如下提醒:
Using TensorFlow backend. E:\anaconda\lib\site-packages\tensorflow\python\framework\dtypes.py:526: 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'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) E:\anaconda\lib\site-packages\tensorflow\python\framework\dtypes.py:527: 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'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) E:\anaconda\lib\site-packages\tensorflow\python\framework\dtypes.py:528: 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'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) E:\anaconda\lib\site-packages\tensorflow\python\framework\dtypes.py:529: 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'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) E:\anaconda\lib\site-packages\tensorflow\python\framework\dtypes.py:530: 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'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) E:\anaconda\lib\site-packages\tensorflow\python\framework\dtypes.py:535: 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'. np_resource = np.dtype([("resource", np.ubyte, 1)])
根据以上提醒,我们要在电脑里找到位于“\anaconda\lib\site-packages\tensorflow\python\framework\”中的“dtypes.py”文件,用我们常用的python编辑器打开它,并将对应行的“ (type, 1) ”都改成“(type, (1,))”就可以了。
修改前:
修改后:
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- 解决python调用TensorFlow时出现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 deprecated; in a future version
- 【Python报错】Keras运行神经网络时,报数据出错:Passing (type, 1) or '1type' as a synonym of type is deprecated
- 【colab pytorch】FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy
- The application is not licensed to modify or create schema for this type of data 解决办法
- Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node 解决办法
- Error in module : Declaration of class TFhygl is missing or incorrect解决办法
- ECShop后台站点地图关于 Deprecated: Assigning the return value of new by reference is deprecated的错误的解决办法
- TypeError: view must be a callable or a list/tuple in the case of include().解决办法
- 显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- Android Studio中新建项目时Your android sdk is out of date or is missing templates的解决办法
- PHP显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- python2.7web代码用python3.6运行时,浏览器发送请求报错TypeError: Object of type 'bytes' is not JSON serializable的解决办法
- This type of page is not served 解决办法
- 【问题解决】Can't parse message of type "..." because it is missing required fields: eType问题的解决办法
- TypeError: view must be a callable or a list/tuple in the case of include().解决办法
- Android Studio中新建项目时Your android sdk is out of date or is missing templates的解决办法
- php 报错Deprecated: Assigning the return value of new by reference is deprecated in的解决办法
- PHP显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- Python json中的Object of type "xxx" is not JSON serializable通用解决办法