|
|
|
|
|
|
import argparse |
|
|
|
|
|
|
|
import os |
|
|
|
from os import path |
|
|
|
import glob |
|
|
|
import shutil |
|
|
|
import numpy as np |
|
|
|
|
|
|
from mlagents.trainers.subprocess_env_manager import SubprocessEnvManager |
|
|
|
from mlagents_envs.side_channel.side_channel import SideChannel |
|
|
|
from mlagents_envs.side_channel.engine_configuration_channel import EngineConfig |
|
|
|
from mlagents_envs.exception import UnityEnvironmentException |
|
|
|
|
|
|
|
|
|
|
|
def _create_parser(): |
|
|
|
|
|
|
env_args: Optional[List[str]], |
|
|
|
) -> Callable[[int, List[SideChannel]], BaseEnv]: |
|
|
|
if env_path is not None: |
|
|
|
if not path.exists(env_path): |
|
|
|
raise UnityEnvironmentException( |
|
|
|
"Couldn't launch the {0} environment. " |
|
|
|
"Provided filename does not match any environments.".format( |
|
|
|
env_path |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
# Strip out executable extensions if passed |
|
|
|
env_path = ( |
|
|
|
env_path.strip() |
|
|
|