kengz / SLM-Lab

Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".
https://slm-lab.gitbook.io/slm-lab/
MIT License
1.25k stars 264 forks source link

how can i run my own environment with "search" mode #378

Closed lidongke closed 5 years ago

lidongke commented 5 years ago

when i run my own e, thienvironment with "search" mode report en error that : my own environment has not register ,(i.e my environment named war3),i think it is because it startup the ray and skip to import war3, but i do not know where should i do " import war3" ,i do this in run_lab.py get the error, but i do this in openai.py ,this error can be resolved. in slm_lab/env/openai.py like this:

from slm_lab.env.base import BaseEnv from slm_lab.env.wrapper import make_gym_env from slm_lab.env.vec_env import make_gym_venv from slm_lab.env.registration import try_register_env from slm_lab.lib import logger, util from slm_lab.lib.decorator import lab_api import gym import numpy as np import pydash as ps import roboschool import war3

logger = logger.get_logger(name) can i import it in my python or run_lab.py , not in your source code? @kengz @lgraesser

kengz commented 5 years ago

Hi, the registration problem is specific to new environment not being registered.

Importing it in openai.py is correct if you environment self-registers, just like how roboschool self-registers when imported there. If you need to register the environment under openai gym, like how vizdoom was registered.

kengz commented 5 years ago

@lidongke seemed like you got search to run. is this issue good to close?

lidongke commented 5 years ago

you can close this issue,thanks~@ kengz