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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章