{"action":"created","issue":{"url":"https://api.github.com/repos/ray-project/ray/issues/3107","repository_url":"https://api.github.com/repos/ray-project/ray","labels_url":"https://api.github.com/repos/ray-project/ray/issues/3107/labels{/name}","comments_url":"https://api.github.com/repos/ray-project/ray/issues/3107/comments","events_url":"https://api.github.com/repos/ray-project/ray/issues/3107/events","html_url":"https://github.com/ray-project/ray/issues/3107","id":372545013,"node_id":"MDU6SXNzdWUzNzI1NDUwMTM=","number":3107,"title":"StopIteration in a custom env ","user":{"login":"oroojlooy","id":20797260,"node_id":"MDQ6VXNlcjIwNzk3MjYw","avatar_url":"https://avatars0.githubusercontent.com/u/20797260?v=4","gravatar_id":"","url":"https://api.github.com/users/oroojlooy","html_url":"https://github.com/oroojlooy","followers_url":"https://api.github.com/users/oroojlooy/followers","following_url":"https://api.github.com/users/oroojlooy/following{/other_user}","gists_url":"https://api.github.com/users/oroojlooy/gists{/gist_id}","starred_url":"https://api.github.com/users/oroojlooy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oroojlooy/subscriptions","organizations_url":"https://api.github.com/users/oroojlooy/orgs","repos_url":"https://api.github.com/users/oroojlooy/repos","events_url":"https://api.github.com/users/oroojlooy/events{/privacy}","received_events_url":"https://api.github.com/users/oroojlooy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-22T14:28:55Z","updated_at":"2018-10-23T06:50:37Z","closed_at":null,"author_association":"NONE","body":"### System information\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Redhat 7.5\r\n- **Ray installed from (source or binary)**: binary \r\n- **Ray version**: 0.5.0 \r\n- **Python version**: 3.6.5\r\n- **Exact command to reproduce**: `agent.train()`\r\n\r\n\r\n### Describe the problem\r\nI try to run ddpg with a custom env, and faced a `StopIteration` error in `sampler.py` on the `next(self.rollout_provider)`, which I could not figure out the root of the problem. I also searched through the list of previous issues and it looks that issue [#1886](https://github.com/ray-project/ray/issues/1886) is the closets issue, but with another error on custom env. \r\n\r\nCan you please let me know how I can fix this error?\r\n\r\nThanks,\r\nAfshin\r\n\r\nHere is the error that I get:\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nStopIteration                             Traceback (most recent call last)\r\n<ipython-input-14-50ae5e4c1e7b> in <module>()\r\n      1 while True:\r\n----> 2     print(agent.train())\r\n\r\n/usr/lib/python3.6/site-packages/ray/tune/trainable.py in train(self)\r\n    115 \r\n    116         start = time.time()\r\n--> 117         result = self._train()\r\n    118         self._iteration += 1\r\n    119         if result.time_this_iter_s is not None:\r\n\r\n/usr/lib/python3.6/site-packages/ray/rllib/agents/dqn/dqn.py in _train(self)\r\n    175         while (self.global_timestep - start_timestep <\r\n    176                self.config[\"timesteps_per_iteration\"]):\r\n--> 177             self.optimizer.step()\r\n    178             self.update_target_if_needed()\r\n    179 \r\n\r\n/usr/lib/python3.6/site-packages/ray/rllib/optimizers/sync_replay_optimizer.py in step(self)\r\n     69                         [e.sample.remote() for e in self.remote_evaluators]))\r\n     70             else:\r\n---> 71                 batch = self.local_evaluator.sample()\r\n     72 \r\n     73             # Handle everything as if multiagent\r\n\r\n/usr/lib/python3.6/site-packages/ray/rllib/evaluation/common_policy_evaluator.py in sample(self)\r\n    258         \"\"\"\r\n    259 \r\n--> 260         batches = [self.sampler.get_data()]\r\n    261         steps_so_far = batches[0].count\r\n    262         while steps_so_far < self.batch_steps:\r\n\r\n/usr/lib/python3.6/site-packages/ray/rllib/evaluation/sampler.py in get_data(self)\r\n     47     def get_data(self):\r\n     48         while True:\r\n---> 49             item = next(self.rollout_provider)\r\n     50             if isinstance(item, RolloutMetrics):\r\n     51                 self.metrics_queue.put(item)\r\n\r\nStopIteration: \r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ray-project/ray/issues/comments/432116623","html_url":"https://github.com/ray-project/ray/issues/3107#issuecomment-432116623","issue_url":"https://api.github.com/repos/ray-project/ray/issues/3107","id":432116623,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjExNjYyMw==","user":{"login":"ericl","id":14922,"node_id":"MDQ6VXNlcjE0OTIy","avatar_url":"https://avatars3.githubusercontent.com/u/14922?v=4","gravatar_id":"","url":"https://api.github.com/users/ericl","html_url":"https://github.com/ericl","followers_url":"https://api.github.com/users/ericl/followers","following_url":"https://api.github.com/users/ericl/following{/other_user}","gists_url":"https://api.github.com/users/ericl/gists{/gist_id}","starred_url":"https://api.github.com/users/ericl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericl/subscriptions","organizations_url":"https://api.github.com/users/ericl/orgs","repos_url":"https://api.github.com/users/ericl/repos","events_url":"https://api.github.com/users/ericl/events{/privacy}","received_events_url":"https://api.github.com/users/ericl/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T06:50:37Z","updated_at":"2018-10-23T06:50:37Z","author_association":"CONTRIBUTOR","body":"> \"0.5.0\"\r\n\r\nAlso, 0.5.0 is really out of date, maybe try and see if its an issue on 0.5.3 or latest?"}}
{"actor":{"display_login":"ericl"}}