-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
I suggest to add in the beginning part of each jupyter notebooks string to check is kaggle notebooks.
Now check only colab
import sys, os
if 'google.colab' in sys.modules and not os.path.exists('.setup_complete'):
!wget -q https://raw.githubusercontent.com/yandexdataschool/Practical_RL/master/setup_colab.sh -O- | bash
!pip install -q gymnasium
!touch .setup_complete
# This code creates a virtual display to draw game images on.
# It will have no effect if your machine has a monitor.
if type(os.environ.get("DISPLAY")) is not str or len(os.environ.get("DISPLAY")) == 0:
!bash ../xvfb start
os.environ['DISPLAY'] = ':1'It can make be replace by this
import sys, os
if ('google.colab' in sys.modules or os.getenv(KAGGLE_KERNEL_RUN_TYPE)) and not os.path.exists('.setup_complete'):
!wget -q https://raw.githubusercontent.com/yandexdataschool/Practical_RL/master/setup_colab.sh -O- | bash
!pip install -q gymnasium
!touch .setup_complete
# This code creates a virtual display to draw game images on.
# It will have no effect if your machine has a monitor.
if type(os.environ.get("DISPLAY")) is not str or len(os.environ.get("DISPLAY")) == 0:
!bash ../xvfb start
os.environ['DISPLAY'] = ':1'Reason for these changes: kaggle notebook gives gpu for 30 hours straight for a week, which is more convenient for debugging experiments.
Metadata
Metadata
Assignees
Labels
No labels