{"action":"closed","issue":{"url":"https://api.github.com/repos/deepmind/pysc2/issues/215","repository_url":"https://api.github.com/repos/deepmind/pysc2","labels_url":"https://api.github.com/repos/deepmind/pysc2/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/deepmind/pysc2/issues/215/comments","events_url":"https://api.github.com/repos/deepmind/pysc2/issues/215/events","html_url":"https://github.com/deepmind/pysc2/issues/215","id":344346277,"node_id":"MDU6SXNzdWUzNDQzNDYyNzc=","number":215,"title":"Problem occured when try to rest the env","user":{"login":"chauvinfish","id":41475196,"node_id":"MDQ6VXNlcjQxNDc1MTk2","avatar_url":"https://avatars0.githubusercontent.com/u/41475196?v=4","gravatar_id":"","url":"https://api.github.com/users/chauvinfish","html_url":"https://github.com/chauvinfish","followers_url":"https://api.github.com/users/chauvinfish/followers","following_url":"https://api.github.com/users/chauvinfish/following{/other_user}","gists_url":"https://api.github.com/users/chauvinfish/gists{/gist_id}","starred_url":"https://api.github.com/users/chauvinfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chauvinfish/subscriptions","organizations_url":"https://api.github.com/users/chauvinfish/orgs","repos_url":"https://api.github.com/users/chauvinfish/repos","events_url":"https://api.github.com/users/chauvinfish/events{/privacy}","received_events_url":"https://api.github.com/users/chauvinfish/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-25T08:38:10Z","updated_at":"2018-11-09T14:51:49Z","closed_at":"2018-11-09T14:51:49Z","author_association":"NONE","body":"Traceback (most recent call last):\r\n  File \"C:\\Users\\yanshengyang\\AppData\\Local\\Programs\\Python\\Python36\\lib\\threading.py\", line 916, in _bootstrap_inner\r\n    self.run()\r\n  File \"C:\\Users\\yanshengyang\\AppData\\Local\\Programs\\Python\\Python36\\lib\\threading.py\", line 864, in run\r\n    self._target(*self._args, **self._kwargs)\r\n  File \"C:\\Users\\yanshengyang\\Desktop\\4rChon\\2018.3.12\\agents\\a3c\\agent.py\", line 106, in <lambda>\r\n    worker_fn = lambda worker=worker: worker.run(coord, FLAGS.max_t)\r\n  File \"C:\\Users\\yanshengyang\\Desktop\\4rChon\\2018.3.12\\agents\\a3c\\worker.py\", line 266, in run\r\n    for recorder, is_done in runner.run_n_steps():\r\n  File \"C:\\Users\\yanshengyang\\Desktop\\4rChon\\2018.3.12\\runner.py\", line 35, in run_n_steps\r\n    timesteps = self.env.reset()\r\n  File \"C:\\Users\\yanshengyang\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\pysc2\\env\\base_env_wrapper.py\", line 39, in reset\r\n    return self._env.reset(*args, **kwargs)\r\n  File \"C:\\Users\\yanshengyang\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\pysc2\\lib\\stopwatch.py\", line 197, in _stopwatch\r\n    return func(*args, **kwargs)\r\n  File \"C:\\Users\\yanshengyang\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\pysc2\\env\\sc2_env.py\", line 434, in reset\r\n    self._metrics.increment_episode()\r\nAttributeError: 'NoneType' object has no attribute 'increment_episode'\r\n\r\nrelated codes in sc2_env.py\r\n`  def reset(self):\r\n    \"\"\"Start a new episode.\"\"\"\r\n    self._episode_steps = 0\r\n    if self._episode_count:\r\n      # No need to restart for the first episode.\r\n      self._restart()\r\n\r\n    self._episode_count += 1\r\n    logging.info(\"Starting episode: %s\", self._episode_count)\r\n    self._metrics.increment_episode()\r\n\r\n    self._last_score = [0] * self._num_agents\r\n    self._state = environment.StepType.FIRST\r\n    return self._step()`\r\n\r\nin runner.py\r\n`    def run_n_steps(self):\r\n        \"\"\"A run loop to have agents and an environment interact.\"\"\"\r\n        if self.is_first_step:\r\n            self.start_time = time.time()\r\n\r\n        steps = 0\r\n        replay_buffer = []\r\n\r\n        try:\r\n            # If starting new episode, reset agent and environment\r\n            if self.is_first_step:\r\n                timesteps = self.env.reset()\r\n                self.timestep = timesteps[0]\r\n                self.agent.reset()\r\n\r\n            while True:\r\n                assert(self.timestep is not None)\r\n\r\n                action = self.agent.step(self.timestep)\r\n\r\n                steps += 1\r\n\r\n                # Yield current buffer if update_period is reached or episode finished\r\n                is_update_ready = steps % self.update_period == 0\r\n                is_done = self.timestep.last()\r\n\r\n                replay_buffer.append([action, self.timestep])\r\n                if is_update_ready or is_done:\r\n                    print(\"Updating at {} - {}\".format(steps, self.update_period))\r\n                    yield replay_buffer, is_done\r\n                if is_done:\r\n                    self._reset()\r\n                    break\r\n\r\n                timesteps = self.env.step([action])\r\n                self.timestep = timesteps[0]\r\n\r\n        except KeyboardInterrupt:\r\n            pass\r\n        finally:\r\n            elapsed_time = time.time() - self.start_time`"}}
{"actor":{"display_login":"tewalds"}}