2016-12-01 7 views
1

Python 3.5コードでTensorflowとTFLearnライブラリを使いたいと思います。私はpipを使用して両方をインストールしました。私は、次のバージョンがありますいくつかのコードを実行している場合しかし、私は次のエラーを取得TypeError: `tf.Tensor`をPython` bool`として使用することはできません

tensorflow 0.12.0rc0 
tflearn 0.2.1 
python 3.5.2 
conda 4.2.13 

:私はthis issue on GitHubから伝えることができるものから

TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed. 

を、この問題はすでに解決されなければなりません。

どうすればこの問題を解決できますか?

EDIT:ここでは、完全なスタックトレースです:

Traceback (most recent call last): 
    File "test.py", line 35, in <module> 
    agent = DQNAgent(create_mlp, n_actions, env.observation_space.shape, min_replay_size=10000, batch_size=64) 
    File "agents.py", line 86, in __init__ 
    self.q_net = network_fn(self.s, self._n_actions) 
    File "test.py", line 23, in create_mlp 
    net = nn.input_data(placeholder=inputs) 
    File "//anaconda/lib/python3.5/site-packages/tflearn/layers/core.py", line 55, in input_data 
    if not shape and not placeholder: 
    File "//anaconda/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 533, in __bool__ 
raise TypeError("Using a `tf.Tensor` as a Python `bool` is not allowed. " 
+0

エラーの完全なスタックトレースを共有できますか?これにより、どのコードが間違っているのかを特定することができます。 – mrry

答えて

0

このバグはtflearn v0.2.1ライブラリによって引き起こされます。

pip install git+https://github.com/tflearn/tflearn.git 

これは、このバグはもはや発生しているtflearn v0.2.2を、インストールされます:このエラーを解決する方法はgit経由で最新バージョンをインストールすることです。

関連する問題