首页 > 解决方案 > When I try to run the 'MountainCar-v0' gym from Open AI, all I get is a black screen

问题描述

I am running this on Mac OSX Mojave with Python 3.7

This is the code I am running, it shold run fine because I am following a tutorial by Sentdex. i have also tried adding a time.sleep(0.1) in the loop but that doesn't work either. I'm at a loss here and I just want to be able to run this agent and do some work on it.

Please help!!

import gym
import time

env = gym.make("MountainCar-v0")
env.reset()

done = False

while not done:
    action = 2
    new_state, reward, done, _ = env.step(action)
    env.render()
    time.sleep(0.1)

env.close()

标签: pythonmacosartificial-intelligence

解决方案


推荐阅读