質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

1回答

3414閲覧

名前tf.gfile.Openは非推奨です。代わりにtf.io.gfile.GFileを使用してください。などの警告が出る。

harunyan333

総合スコア13

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2020/01/19 00:52

編集2020/01/19 01:04

magentaで自動作曲に挑戦しています。

インストールしたもの
Home Brew
pyenv 1.2.15
Python 3.7.4
Anaconda 3-2019.10
Tensorflow 1.15.0
Magenta 1.2.2

https://takacity.blog.fc2.com/?no=226#comment
この方のを参考にdrum_kit_rnn.magをダウンロードして
/Desktop/magenta/magenta/models/drums_rnn/drum_kit_rnn.mag に入れました。
そしてsource activate magentaで下記のコマンドを入れました。

drums_rnn_generate \ --config=drums_rnn \ --bundle_file=~/Desktop/magenta/magenta/models/drums_rnn/drum_kit_rnn.mag \ --output_dir=~/Desktop/magenta/magenta/output \ --num_outputs=10 \ --num_steps=128 \ --primer_drums="[(36, 42), (), (42,)]"

すると、

WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:260: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead. WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:228: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead. W0119 09:54:20.424452 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:228: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead. WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/shared/sequence_generator_bundle.py:30: The name tf.gfile.Open is deprecated. Please use tf.io.gfile.GFile instead. W0119 09:54:20.425223 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/shared/sequence_generator_bundle.py:30: The name tf.gfile.Open is deprecated. Please use tf.io.gfile.GFile instead. WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:150: The name tf.gfile.Exists is deprecated. Please use tf.io.gfile.exists instead. W0119 09:54:20.476548 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:150: The name tf.gfile.Exists is deprecated. Please use tf.io.gfile.exists instead. WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:151: The name tf.gfile.MakeDirs is deprecated. Please use tf.io.gfile.makedirs instead. W0119 09:54:20.478234 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:151: The name tf.gfile.MakeDirs is deprecated. Please use tf.io.gfile.makedirs instead. WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:208: The name tf.logging.debug is deprecated. Please use tf.compat.v1.logging.debug instead. W0119 09:54:20.481306 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/drums_rnn/drums_rnn_generate.py:208: The name tf.logging.debug is deprecated. Please use tf.compat.v1.logging.debug instead. WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/music/model.py:70: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead. W0119 09:54:20.579112 4504520128 module_wrapper.py:139] From /Users/iユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/music/model.py:70: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead. 2020-01-19 09:54:20.583973: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2020-01-19 09:54:20.636980: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fe2fead5b00 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2020-01-19 09:54:20.637019: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/music/model.py:71: The name tf.train.import_meta_graph is deprecated. Please use tf.compat.v1.train.import_meta_graph instead. W0119 09:54:20.641800 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/music/model.py:71: The name tf.train.import_meta_graph is deprecated. Please use tf.compat.v1.train.import_meta_graph instead. 2020-01-19 09:54:20.698242: W tensorflow/core/framework/op_def_util.cc:357] Op TensorArray is deprecated. It will cease to work in GraphDef version 16. Use TensorArrayV3. 2020-01-19 09:54:20.700002: W tensorflow/core/framework/op_def_util.cc:357] Op TensorArrayScatter is deprecated. It will cease to work in GraphDef version 19. Use TensorArrayGradV3. 2020-01-19 09:54:20.700899: W tensorflow/core/framework/op_def_util.cc:357] Op TensorArrayRead is deprecated. It will cease to work in GraphDef version 16. Use TensorArrayReadV3. 2020-01-19 09:54:20.709968: W tensorflow/core/framework/op_def_util.cc:357] Op TensorArrayWrite is deprecated. It will cease to work in GraphDef version 16. Use TensorArrayWriteV3. 2020-01-19 09:54:20.710308: W tensorflow/core/framework/op_def_util.cc:357] Op TensorArraySize is deprecated. It will cease to work in GraphDef version 16. Use TensorArraySizeV3. 2020-01-19 09:54:20.710620: W tensorflow/core/framework/op_def_util.cc:357] Op TensorArrayGather is deprecated. It will cease to work in GraphDef version 16. Use TensorArrayGatherV3. WARNING:tensorflow:The saved meta_graph is possibly from an older release: 'model_variables' collection should be of type 'byte_list', but instead is of type 'node_list'. W0119 09:54:20.781531 4504520128 meta_graph.py:887] The saved meta_graph is possibly from an older release: 'model_variables' collection should be of type 'byte_list', but instead is of type 'node_list'. INFO:tensorflow:Restoring parameters from /var/folders/53/5c2q4gbx4ld2_py0h_8dtdv40000gn/T/tmp8tqcmkdz/model.ckpt I0119 09:54:20.784827 4504520128 saver.py:1284] Restoring parameters from /var/folders/53/5c2q4gbx4ld2_py0h_8dtdv40000gn/T/tmp8tqcmkdz/model.ckpt WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/shared/sequence_generator.py:159: The name tf.gfile.DeleteRecursively is deprecated. Please use tf.io.gfile.rmtree instead. W0119 09:54:21.023826 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/shared/sequence_generator.py:159: The name tf.gfile.DeleteRecursively is deprecated. Please use tf.io.gfile.rmtree instead. WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/shared/events_rnn_model.py:380: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead. W0119 09:54:21.560704 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/models/shared/events_rnn_model.py:380: The name tf.logging.info is deprecated. Please use tf.compat.v1.logging.info instead. INFO:tensorflow:Beam search yields sequence with log-likelihood: -37.551918 I0119 09:54:21.560995 4504520128 events_rnn_model.py:381] Beam search yields sequence with log-likelihood: -37.551918 WARNING:tensorflow:From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/music/midi_io.py:220: The name tf.gfile.Copy is deprecated. Please use tf.io.gfile.copy instead. W0119 09:54:21.588675 4504520128 module_wrapper.py:139] From /Users/ユーザー名/.pyenv/versions/anaconda3-2019.10/lib/python3.7/site-packages/magenta/music/midi_io.py:220: The name tf.gfile.Copy is deprecated. Please use tf.io.gfile.copy instead. INFO:tensorflow:Beam search yields sequence with log-likelihood: -44.038765 I0119 09:54:21.994347 4504520128 events_rnn_model.py:381] Beam search yields sequence with log-likelihood: -44.038765 INFO:tensorflow:Beam search yields sequence with log-likelihood: -99.669579 I0119 09:54:22.395879 4504520128 events_rnn_model.py:381] Beam search yields sequence with log-likelihood: -99.669579 INFO:tensorflow:Beam search yields sequence with log-likelihood: -23.765722 I0119 09:54:22.827630 4504520128 events_rnn_model.py:381] Beam search yields sequence with log-likelihood: -23.765722 ・ ・ ・ INFO:tensorflow:Wrote 10 MIDI files to /Users/ユーザー名/Desktop/magenta/magenta/output I0119 09:54:25.575386 4504520128 drums_rnn_generate.py:223] Wrote 10 MIDI files to /Users/ユーザー名/Desktop/magenta/magenta/output

という警告などが出ました。

これはtensorflowのバージョンのせいでしょうか?
これを解決させる方法を教えてください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

そのパッケージが最新版であるなら、
案1:気にしない
案2:自分で修正する
のどちらかです。

投稿2020/01/19 01:15

otn

総合スコア84555

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

harunyan333

2020/01/19 08:35

TensorFlowのバージョンではなくパッケージですか? これ気にしなくても大丈夫なんですか?
otn

2020/01/19 13:34

「magentaというパッケージのバージョンが」という意味です。 古いメソッドを使うなという警告なので、気にしなくていいです。 Tensorflowのバージョンがさらに進むとメソッドが使えなくなると思いますが、その時までにはmagenta側で対処するでしょう。もしくは、magentaがメンテされてないなら、使えなくなるか。 自分で書いたプログラムでこういう警告が出たら、古いメソッドを使わないように書き直します。 案3:がありました。 Tensorflowのバージョンを古くする。 警告を消すためにバージョンを古くするのは意味がないですが、まあ、方法としてはあります。
harunyan333

2020/01/20 05:53

magentaのバージョンは最新です。 警告たくさん出ててもちゃんとoutputに出力されてました! ありがとうございます。 Tensorflowのバージョンは最新ではないんですけどもっと古いやつじゃないと消えないんですね。 今はとりあえず気にせずやってみようと思います。 ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問