microsoft / TextWorld

​TextWorld is a sandbox learning environment for the training and evaluation of reinforcement learning (RL) agents on text-based games.
Other
1.22k stars 189 forks source link

'module textworld has no attribute render' #352

Closed christopherzc closed 1 month ago

christopherzc commented 1 month ago

Hello,

I am trying to run the "Handcrafting a game.ipynb" notebook in colab, however I run into the error 'module 'textworld' has no attribute 'render'' at the third cell.

MarcCote commented 1 month ago

Hi @christopherzc, I just want to make sure, did you install the visualization dependencies? (see https://github.com/microsoft/TextWorld?tab=readme-ov-file#visualization)

pip install textworld[vis]
christopherzc commented 1 month ago

Hi @MarcCote , thanks for responding so quickly!

I believe so, in the first cell I ran:

!apt install chromium-chromedriver
!pip install selenium==3.12.0
# then
!pip install textworld[vis]

Followed by:

import textworld
from textworld import GameMaker

# Make the generation process reproducible.
from textworld import g_rng  # Global random generator.
g_rng.set_seed(20180916)

# GameMaker object for handcrafting text-based games.
M = GameMaker()

However on the third cell:

roomA = M.new_room("Room A")
roomB = M.new_room("Room B")
corridor = M.connect(roomA.east, roomB.west)
M.render()

The line M.render() returns the error:

image

MarcCote commented 1 month ago

My bad, it seems a typo sneaked in 10 months ago. Thanks!