{"action":"closed","issue":{"url":"https://api.github.com/repos/reinforceio/tensorforce/issues/322","repository_url":"https://api.github.com/repos/reinforceio/tensorforce","labels_url":"https://api.github.com/repos/reinforceio/tensorforce/issues/322/labels{/name}","comments_url":"https://api.github.com/repos/reinforceio/tensorforce/issues/322/comments","events_url":"https://api.github.com/repos/reinforceio/tensorforce/issues/322/events","html_url":"https://github.com/reinforceio/tensorforce/issues/322","id":293952332,"number":322,"title":"Custom baseline network throws `object has no attribute 'internals_input'` (memory branch)","user":{"login":"lefnire","id":195202,"avatar_url":"https://avatars3.githubusercontent.com/u/195202?v=4","gravatar_id":"","url":"https://api.github.com/users/lefnire","html_url":"https://github.com/lefnire","followers_url":"https://api.github.com/users/lefnire/followers","following_url":"https://api.github.com/users/lefnire/following{/other_user}","gists_url":"https://api.github.com/users/lefnire/gists{/gist_id}","starred_url":"https://api.github.com/users/lefnire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lefnire/subscriptions","organizations_url":"https://api.github.com/users/lefnire/orgs","repos_url":"https://api.github.com/users/lefnire/repos","events_url":"https://api.github.com/users/lefnire/events{/privacy}","received_events_url":"https://api.github.com/users/lefnire/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-02T16:48:28Z","updated_at":"2018-02-02T21:37:16Z","closed_at":"2018-02-02T21:37:16Z","author_association":"CONTRIBUTOR","body":"```shell\r\n  File \"/home/lefnire/tensorforce/tensorforce/agents/ppo_agent.py\", line 176, in __init__\r\n    entropy_regularization=entropy_regularization\r\n  File \"/home/lefnire/tensorforce/tensorforce/agents/learning_agent.py\", line 132, in __init__\r\n    batching_capacity=batching_capacity\r\n  File \"/home/lefnire/tensorforce/tensorforce/agents/agent.py\", line 86, in __init__\r\n    self.model = self.initialize_model()\r\n  File \"/home/lefnire/tensorforce/tensorforce/agents/ppo_agent.py\", line 204, in initialize_model\r\n    likelihood_ratio_clipping=self.likelihood_ratio_clipping\r\n  File \"/home/lefnire/tensorforce/tensorforce/models/pg_prob_ratio_model.py\", line 88, in __init__\r\n    gae_lambda=gae_lambda\r\n  File \"/home/lefnire/tensorforce/tensorforce/models/pg_model.py\", line 96, in __init__\r\n    requires_deterministic=False\r\n  File \"/home/lefnire/tensorforce/tensorforce/models/distribution_model.py\", line 87, in __init__\r\n    discount=discount\r\n  File \"/home/lefnire/tensorforce/tensorforce/models/memory_model.py\", line 80, in __init__\r\n    reward_preprocessing=reward_preprocessing\r\n  File \"/home/lefnire/tensorforce/tensorforce/models/model.py\", line 212, in __init__\r\n    self.setup()\r\n  File \"/home/lefnire/tensorforce/tensorforce/models/model.py\", line 318, in setup\r\n    self.initialize(custom_getter=custom_getter)\r\n  File \"/home/lefnire/tensorforce/tensorforce/models/pg_prob_ratio_model.py\", line 92, in initialize\r\n    super(PGProbRatioModel, self).initialize(custom_getter)\r\n  File \"/home/lefnire/tensorforce/tensorforce/models/pg_model.py\", line 116, in initialize\r\n    summary_labels=self.summary_labels\r\n  File \"/home/lefnire/tensorforce/tensorforce/core/baselines/baseline.py\", line 132, in from_spec\r\n    kwargs=kwargs\r\n  File \"/home/lefnire/tensorforce/tensorforce/util.py\", line 157, in get_object\r\n    return obj(*args, **kwargs)\r\n  File \"/home/lefnire/tensorforce/tensorforce/core/baselines/network_baseline.py\", line 44, in __init__\r\n    assert len(self.network.internals_input()) == 0\r\nAttributeError: 'CustomNet' object has no attribute 'internals_input'\r\n```\r\n\r\nThis is a custom-defined network which adds some inputs downstream, very similar to the custom net in `test_tutorial_code.py`. [Network definition code](https://github.com/lefnire/tforce_btc_trader/blob/22dc955aaf6186e6be934a7d29118cf121bbb0b8/hypersearch.py#L118tL170), [baseline-assignment code](https://github.com/lefnire/tforce_btc_trader/blob/22dc955aaf6186e6be934a7d29118cf121bbb0b8/hypersearch.py#L528tL533). The network works fine as the main model network, but when used as a baseline network it throws that error. The same code works fine in the master branch.\r\n\r\n--- \r\n\r\nEdit: removing that `assert len(..)` kicks the error, but I don't know what side-effects that has\r\n\r\n```diff\r\ndiff --git a/tensorforce/core/baselines/network_baseline.py b/tensorforce/core/baselines/network_baseline.py\r\nindex e9c592a..b9fb93b 100755\r\n--- a/tensorforce/core/baselines/network_baseline.py\r\n+++ b/tensorforce/core/baselines/network_baseline.py\r\n@@ -41,7 +41,7 @@ class NetworkBaseline(Baseline):\r\n             spec=network_spec,\r\n             kwargs=dict(summary_labels=summary_labels)\r\n         )\r\n-        assert len(self.network.internals_input()) == 0\r\n+        #assert len(self.network.internals_input()) == 0\r\n\r\n         self.linear = Linear(size=1, bias=0.0, scope='prediction')\r\n```"}}
{"actor":{"display_login":"AlexKuhnle"}}