浏览代码

Added --cpu flag to train using CPU only (#2755)

/develop-gpu-test
Chris Elion 5 年前
当前提交
c531f87d
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 3
      docs/Training-ML-Agents.md
  2. 8
      ml-agents/mlagents/trainers/learn.py

3
docs/Training-ML-Agents.md


details.
* `--debug`: Specify this option to enable debug-level logging for some parts of the code.
* `--multi-gpu`: Setting this flag enables the use of multiple GPU's (if available) during training.
* `--cpu`: Forces training using CPU only.
### Training Config File

8
ml-agents/mlagents/trainers/learn.py


sampler_file_path: Optional[str]
docker_target_name: Optional[str]
env_args: Optional[List[str]]
cpu: bool
@property
def fast_simulation(self) -> bool:

nargs=argparse.REMAINDER,
help="Arguments passed to the Unity executable.",
)
parser.add_argument(
"--cpu", default=False, action="store_true", help="Run with CPU only"
)
args = parser.parse_args(argv)
return CommandLineOptions.from_argparse(args)

jobs = []
run_seed = options.seed
if options.cpu:
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
if options.num_runs == 1:
if options.seed == -1:
run_seed = np.random.randint(0, 10000)

正在加载...
取消
保存