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

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

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

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Q&A

解決済

1回答

313閲覧

tensorlayerでの引数エラー(?)について

Mr.tiinpara

総合スコア37

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

0グッド

0クリップ

投稿2018/03/14 11:19

##環境
windows
python3
tensorlayer1.8.1
tensorflow1.6.0
##したい事
https://github.com/tensorlayer/seq2seq-chatbot
のプログラムを動かしたい
##問題点
以下のエラーが出ているが、自信の経験値的にエラー内容が分かりません。
引数が足りないよとの事を言われてそうなのですが、どこで関数を呼び出しているのかも分かりません。
また、開発者と同様のバージョンにしようとしたのですが、tensorlayerの過去バージョンをどこからDLすればいいのか分かりません。

encode_seqs ['wednesday', 'and', 'thursday', 'in', 'seattle', 's', 'big', 'conference', '']
target_seqs ['wish', 'but', 'cant', 'travel', 'enjoy', 'end_id']
decode_seqs ['start_id', 'wish', 'but', 'cant', 'travel', 'enjoy']
target_mask [1 1 1 1 1 1]
6 6 6
[TL] EmbeddingInputlayer model/embedding/seq_embedding: (8004, 1024)
WARNING:tensorflow:From E:/AI/venv/chatbot_test/seq2seq-chatbot-master/main_simple_seq2seq.py:85: set_name_reuse (from tensorlayer.layers.core) is deprecated and will be removed after 2018-06-30.
Instructions for updating:
TensorLayer relies on TensorFlow to check name reusing.
[TL] From E:/AI/venv/chatbot_test/seq2seq-chatbot-master/main_simple_seq2seq.py:85: set_name_reuse (from tensorlayer.layers.core) is deprecated and will be removed after 2018-06-30.
Instructions for updating:
TensorLayer relies on TensorFlow to check name reusing.
[TL] this method is DEPRECATED and has no effect, please remove it from your code.
[TL] EmbeddingInputlayer model/embedding/seq_embedding: (8004, 1024)
[TL] [] Seq2Seq model/seq2seq: n_hidden:1024 cell_fn:BasicLSTMCell dropout:0.5 n_layer:3
[TL] DynamicRNNLayer model/seq2seq/encode: n_hidden:1024, in_dim:3 in_shape:(32, ?, 1024) cell_fn:BasicLSTMCell dropout:0.5 n_layer:3
[TL] batch_size (concurrent processes): 32
[TL] DynamicRNNLayer model/seq2seq/decode: n_hidden:1024, in_dim:3 in_shape:(32, ?, 1024) cell_fn:BasicLSTMCell dropout:0.5 n_layer:3
[TL] batch_size (concurrent processes): 32
[TL] DenseLayer model/output: 8004 identity
[TL] EmbeddingInputlayer model/embedding/seq_embedding: (8004, 1024)
[TL] this method is DEPRECATED and has no effect, please remove it from your code.
[TL] EmbeddingInputlayer model/embedding/seq_embedding: (8004, 1024)
[TL] [
] Seq2Seq model/seq2seq: n_hidden:1024 cell_fn:BasicLSTMCell dropout:None n_layer:3
[TL] DynamicRNNLayer model/seq2seq/encode: n_hidden:1024, in_dim:3 in_shape:(1, ?, 1024) cell_fn:BasicLSTMCell dropout:None n_layer:3
[TL] batch_size (concurrent processes): 1
Traceback (most recent call last):
File "E:\Anaconda3\envs\untitled\lib\site-packages\tensorlayer\layers\recurrent.py", line 1086, in init
self.cell = MultiRNNCell_fn([cell_creator(is_last=i == n_layer - 1) for i in range(n_layer)], state_is_tuple=True)
File "E:\Anaconda3\envs\untitled\lib\site-packages\tensorlayer\layers\recurrent.py", line 1086, in <listcomp>
self.cell = MultiRNNCell_fn([cell_creator(is_last=i == n_layer - 1) for i in range(n_layer)], state_is_tuple=True)
TypeError: <lambda>() got an unexpected keyword argument 'is_last'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:/AI/venv/chatbot_test/seq2seq-chatbot-master/main_simple_seq2seq.py", line 115, in <module>
decode_seqs2 = tf.placeholder(dtype=tf.int64, shape=[1, None], name="decode_seqs")
File "E:/AI/venv/chatbot_test/seq2seq-chatbot-master/main_simple_seq2seq.py", line 101, in model
return_seq_2d = True,
File "E:\Anaconda3\envs\untitled\lib\site-packages\tensorlayer\layers\recurrent.py", line 1569, in init
name='encode')
File "E:\Anaconda3\envs\untitled\lib\site-packages\tensorlayer\layers\recurrent.py", line 1089, in init
self.cell = MultiRNNCell_fn([cell_creator(is_last=i == n_layer - 1) for i in range(n_layer)])
File "E:\Anaconda3\envs\untitled\lib\site-packages\tensorlayer\layers\recurrent.py", line 1089, in <listcomp>
self.cell = MultiRNNCell_fn([cell_creator(is_last=i == n_layer - 1) for i in range(n_layer)])

TypeError: <lambda>() got an unexpected keyword argument 'is_last'
##求めている事
エラーの解消 OR tensorlayerの過去バージョンのインストール元を教えていただきたいです。

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

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

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

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

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

guest

回答1

0

ベストアンサー

git clone https://github.com/tensorlayer/tensorlayer
でソースコードを持ってきてから、
cd tensorlayer
git tag
でバージョンを確認できます。

例えば、v1.2がほしいのであれば、
git checkout v1.2 -b v1.2
とすることでバージョンを切り替えることができます。

その後に、
python setup.py install
すればインストールできます。


いろいろとdeprecateの警告が出ているので、単純にエラーを解消しても挙動が同じになることを注意深く確認する必要があります。

投稿2018/03/14 15:43

mkgrei

総合スコア8560

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

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

Mr.tiinpara

2018/03/15 14:19

エラーは解消されました!ありがとうございました!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問