Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to create a custom open ai gym environment and I'm struggling to understand how to get my observation space set up correctly.

Lets say I want my observation space to have 4 values, each with a minimum of -4 and a max of 4. I define the observation space like this in my environment's init function:

self.observation_space = Box(low = np.array([-4, -4, -4, -4]), high = np.array([4, 4, 4, 4]))

but when I go to fit my dqn model, I get this error:

"ValueError: Error when checking input: expected dense_3_input to have 2 dimensions, but got array with shape (1, 1, 4)"

If anyone can help me understand what I've done wrong I'd really appreciate it. Thanks

question from:https://stackoverflow.com/questions/65918525/need-help-getting-my-observation-space-in-the-right-shape-openaitensorflow

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
997 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...