Google Colab中VizDoom 1.1.7加载basic.cfg遇FileDoesNotExistException
Hey there, I’ve run into this exact issue before when working with ViZDoom on Colab—let’s get this sorted out quickly!
The root problem here is straightforward: Google Colab starts with a clean, empty working directory, and it doesn’t come pre-loaded with ViZDoom’s sample config/wad files like basic.cfg or basic.wad. You need to manually download these files first before your code can find them.
Here are two simple ways to fix this:
Option 1: Download individual files directly
Use wget to pull just the files you need into your Colab workspace:
# Download the basic config file !wget https://raw.githubusercontent.com/mwydmuch/ViZDoom/master/examples/scenarios/basic.cfg # Download the corresponding WAD file !wget https://raw.githubusercontent.com/mwydmuch/ViZDoom/master/examples/scenarios/basic.wad
Once these are downloaded, your original code will work exactly as written, since the files are now in your current working directory. You can verify they’re there by running !ls to list the contents of your workspace.
Option 2: Clone the entire ViZDoom repository
If you plan to use more sample scenarios later, cloning the full repo saves you from downloading files one by one:
!git clone https://github.com/mwydmuch/ViZDoom.git
Then just update your code to point to the correct path inside the cloned repo:
from vizdoom import * game = DoomGame() # Use the full path to the cfg file in the cloned repo game.load_config("ViZDoom/examples/scenarios/basic.cfg") # Do the same for the WAD file game.set_doom_scenario_path("ViZDoom/examples/scenarios/basic.wad") game.init()
Either method should resolve the FileDoesNotExistException immediately. Just make sure you run the download/clone commands before executing your ViZDoom setup code!
内容的提问来源于stack exchange,提问作者Owase Sayyad

