FutureWarning of tensorFlow and numpy

Scenario description:

When using the SpecAugment package, from specAugment import spec_augment_tensorflow reports a warning, which is as follows:

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

the reason:

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

  • In the version of TensorFlow 2.0.b1, if the version of Numpy exceeds 1.17, this warning will appear.

solve

  1. Fallback version:
pip install "numpy<1.17"
  1. Ignore the warning manually
import warnings
warnings.filterwarnings('ignore', category=FutureWarning)

Guess you like

Origin blog.csdn.net/u013894391/article/details/103254913