在Google Colab中运行DQN pygame脚本时出错

A_N*_*A_N 1 python pygame deep-learning jupyter-notebook google-colaboratory

当我在Google Colab上使用Pygame运行DQN脚本时,会引发错误-

pygame.error:没有可用的视频设备

我正在尝试在Google Colab上运行此GitHub存储库。pong_neural_network_live

使用以下代码安装了Pygame-

import os
!git clone https://github.com/ntasfi/PyGame-Learning-Environment.git
os.chdir('PyGame-Learning-Environment')
!pip install -e .
!pip install pygame
os.chdir('/content')
Run Code Online (Sandbox Code Playgroud)

在尝试初始化并运行以下代码时

import pygame
pygame.init()
pygame.display.list_modes()
Run Code Online (Sandbox Code Playgroud)

我懂了

错误:视频系统未初始化

PS:我还启用了Google Chrome浏览器中的第三方Cookie。

Kor*_*ich 5

Colab在云中运行。它无法将显示发送到计算机上的窗口。因此,您不能使用Pygame。或者,您需要像VNC这样的聪明黑客。