FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated

后端 未结 11 1088
眼角桃花
眼角桃花 2020-12-07 13:53

After updating my Numpy and Tensorflow I am getting these kind of warnings. I had already tried these, but nothing works, every suggestion will be

11条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 14:37

    None of the above worked in my case and I did not want to downgrade any package.

    There is a straightforward solution on Github, just suppress the warning:

    import warnings
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore",category=FutureWarning)
        import numpy as np
        import tensorflow as tf
        import h5py as h5py
    

    and then import whatever package causes the error (numpy, tensorflow, h5py) within the scope of the with statement

提交回复
热议问题