tensorFlow和numpy的futureWarning

情景描述:

在使用SpecAugment包时,from specAugment import spec_augment_tensorflow 报警告,警告如下:

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)])

原因:

参考:FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future ver

  • 在TensorFlow 2.0.b1的版本下,如果Numpy的版本超过了1.17,那么就会出现这个警告。

解决

  1. 回退版本:
pip install "numpy<1.17"
  1. 手动忽略警告
import warnings
warnings.filterwarnings('ignore', category=FutureWarning)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章