openai/spinningup

Could not broadcast input array from shape (96,96,3) into shape (3) Gym CarRacing-v0

Opened this issue · 2 comments

I would like to implement the Gym CarRacing environment with SAC, but when I try to launch the algo I get the error: "could not broadcast input array from shape (96,96,3) into shape (3)". It is obviously an error related to the fact that SAC expects a size 1 obs while CARRACING has an obs of size three.
How do I solve this? And what does it mean "flattens action before sending to environment" specified on the label of the script?

PS: I'm a beginner in RL and python
Thank you

Right on, I like this problem description better. I still haven't made any progress - I have mostly been looking at the DQN Algorithm Code from the DeepMind RL Patent. My thought is the best way to learn is to hashtag out code explanations line by line and then re-create it with the CarRacing-v0 env.

@FlavioLorenzi
What do you mean:

"It is obviously an error related to the fact that SAC expects a size 1 obs while CARRACING has an obs of size three."?

Specifically, you state there is an "obvious error" - but, the only thing that's obvious is neither you, nor @christopherhesse can solve the problem. In fact, you can't even describe it. You say the error is: "related to the fact that SAC expects a size 1 obs while CARRACING has an obs of size three." But, that doesn't mean the fact that SAC expects a size 1 obs while CARRACING has an obs of size three is causing the problem. That's a logical fallacy known as the assumption of cause. Indeed, to solve problems - you have to ask "what is causing the problem?"

The problem is the code won't produce the results we want. Here, there is an undiscovered cause stemming from the underlying architecture of the SAC Algorithm or CarRacing-v0 Environment - the result is a failed convergence. The solution is find a way to bridge the gap between SAC exceptions and the CarRacing-v0 env. In other words, write a SAC algorithm from scratch with a 3-D vector observation space.