Have you tried using multiple cpu on the Example here in A2C?See original GitHub issue
I am trying to use multiple cpu for the example provided on this link?
I tried to change the environment to multiple cpu.
env = DummyVecEnv([env_maker for i in range(16)])
But I have a problem in the done and info in stable baselines. It seems they turned into arrays.
There is an error in this code: any suggestions or any of you done this? It seems lstm in stable baselines are like this.
#env = env_maker() #observation = env.reset() while True: #observation = observation[np.newaxis, ...] # action = env.action_space.sample() action, _states = model.predict(observation) observation, reward, done, info = env.step(action) # env.render() if done: print("info:", info) break ------------------------------ Error: ```python ValueError Traceback (most recent call last) <ipython-input-27-2d78acbb8800> in <module> 10 11 # env.render() ---> 12 if done: 13 print("info:", info) 14 break ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Thanks man 😃
Yeah, somehow, but I didn’t override
DummyVecEnv itself this time. I inherited a new class from it (
DummyVecEnv2) and overrode its
You are a Guru! It works now. What you did was after learning, override the DummyvecEnv by removing the reset. Am i correct?