openai / universe-starter-agent

A starter agent that can solve a number of universe environments.
MIT License
1.1k stars 318 forks source link

AttributeError: 'VectorizeFilter' object has no attribute 'filter_n' #49

Closed jhurliman closed 7 years ago

jhurliman commented 7 years ago

Following the setup instructions on OSX I get most of the way toward a working setup, but training fails with this message:

[2017-01-11 14:46:17,526] Starting training at step=0
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/jhurliman/anaconda/envs/universe-starter-agent/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/Users/jhurliman/Code/openai/universe-starter-agent/a3c.py", line 92, in run
    self._run()
  File "/Users/jhurliman/Code/openai/universe-starter-agent/a3c.py", line 101, in _run
    self.queue.put(next(rollout_provider), timeout=600.0)
  File "/Users/jhurliman/Code/openai/universe-starter-agent/a3c.py", line 112, in env_runner
    last_state = env.reset()
  File "/Users/jhurliman/anaconda/envs/universe-starter-agent/lib/python3.5/site-packages/gym/core.py", line 123, in reset
    observation = self._reset()
  File "/Users/jhurliman/anaconda/envs/universe-starter-agent/lib/python3.5/site-packages/universe/wrappers/vectorize.py", line 46, in _reset
    observation_n = self.env.reset()
  File "/Users/jhurliman/anaconda/envs/universe-starter-agent/lib/python3.5/site-packages/gym/core.py", line 123, in reset
    observation = self._reset()
  File "/Users/jhurliman/anaconda/envs/universe-starter-agent/lib/python3.5/site-packages/universe/vectorized/vectorize_filter.py", line 27, in _reset
    observation_n = [filter._after_reset(observation) for filter, observation in zip(self.filter_n, observation_n)]
AttributeError: 'VectorizeFilter' object has no attribute 'filter_n'
jhurliman commented 7 years ago

I see this is a problem in universe that was recently fixed upstream, I need to either switch to the master branch of universe or wait for a new version to publish to pip.

https://github.com/openai/universe/issues/96

tlbtlbtlb commented 7 years ago

You can work around it for now by calling env.configure() right after env=gym.make(...)

tlbtlbtlb commented 7 years ago

PyPI now has universe 0.21.2, which fixes the problem