Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
13
Help us understand the problem. What is going on with this article?
@cygmin

Chainer, Tensorflowライブラリインポート時のnumpy FutureWarningを解決する

More than 1 year has passed since last update.

環境

Anaconda: 4.4.10
numpy: 1.14.3
tensorflow: 1.8.0
chainer: 4.0.0

問題点

2018年5月現在, Winodws上のAnacondaでChainerとTensorflowを導入したところ, ライブラリのimport時に以下の警告が表示された.

>>> import tensorflow as tf
C:\Users\...\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated.
In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
>>>

Chainerのライブラリをインポートしたときも同様.

見た感じh5pyってパッケージがnumpy使ってる部分で警告出してるっぽい.
試しにh5pyをライブラリとして単体でインポートしても同じ警告が出る.
警告はインポート時に出るだけでライブラリ自体は問題なく使えてそうなんだけど, 毎度出てるのも煩わしいし人に貸したとき何コレってなるから何とかしたい.

因みにエラーを吐いてるh5pyのバージョンは2.7.1でした.

解決策

GitHubにIssuesがあった.

解決を確認した方法は以下の2つ.

  • h5pyのバージョンを上げる

pip install h5py==2.8.0rc1

  • numpyのバージョンを下げる.

pip install numpy==1.13.3

どちらかお好みの方法でどうぞ.

蛇足: h5pyって何ぞ

GitHubより.

h5py is a thin, pythonic wrapper around the HDF5, which runs on Python 2.7, and Python 3 (3.4-3.6).

PythonでHDF5を扱うためのラッパーだそう.
HDF5について詳しくはGoogle先生にお尋ねください.

13
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
13
Help us understand the problem. What is going on with this article?