浏览代码

Merge branch 'develop' into release-v0.6

/develop-generalizationTraining-TrainerController
GitHub 6 年前
当前提交
f5764c98
共有 5 个文件被更改,包括 34 次插入15 次删除
  1. 2
      docs/Installation.md
  2. 1
      docs/Migrating.md
  3. 34
      ml-agents/mlagents/trainers/trainer_controller.py
  4. 2
      ml-agents/setup.py
  5. 10
      ml-agents/requirements.txt

2
docs/Installation.md


### Install Python and mlagents Package
In order to use ML-Agents toolkit, you need Python 3.6 along with the
dependencies listed in the [requirements file](../ml-agents/requirements.txt).
dependencies listed in the [setup.py file](../ml-agents/setup.py).
Some of the primary dependencies include:
- [TensorFlow](Background-TensorFlow.md)

1
docs/Migrating.md


`LearningBrain` ScriptableObjects used in your scene into entries
into this list.
## Migrating from ML-Agents toolkit v0.4 to v0.5
### Important

34
ml-agents/mlagents/trainers/trainer_controller.py


"""Launches trainers for each External Brains in a Unity Environment."""
import os
import glob
import shutil
import yaml
import re

docker_target_name=docker_target_name,
run_id=run_id)
if env_path is not None:
env_path = '/{docker_target_name}/{env_name}'.format(
docker_target_name=docker_target_name, env_name=env_path)
"""
Comments for future maintenance:
Some OS/VM instances (e.g. COS GCP Image) mount filesystems
with COS flag which prevents execution of the Unity scene,
to get around this, we will copy the executable into the
container.
"""
# Navigate in docker path and find env_path and copy it.
env_path = self._prepare_for_docker_run(docker_target_name,
env_path)
if curriculum_folder is not None:
self.curriculum_folder = \
'/{docker_target_name}/{curriculum_folder}'.format(

'curriculum file has the same '
'name as the Brain '
'whose curriculum it defines.')
def _prepare_for_docker_run(self, docker_target_name, env_path):
for f in glob.glob('/{docker_target_name}/*'.format(
docker_target_name=docker_target_name)):
if env_path in f:
try:
b = os.path.basename(f)
if os.path.isdir(f):
shutil.copytree(f,
'/ml-agents/{b}'.format(b=b))
else:
src_f = '/{docker_target_name}/{b}'.format(
docker_target_name=docker_target_name, b=b)
dst_f = '/ml-agents/{b}'.format(b=b)
shutil.copyfile(src_f, dst_f)
os.chmod(dst_f, 0o775) # Make executable
except Exception as e:
self.logger.info(e)
env_path = '/ml-agents/{env_name}'.format(env_name=env_path)
return env_path
def _get_measure_vals(self):
if self.meta_curriculum:

2
ml-agents/setup.py


'matplotlib',
'numpy>=1.13.3,<=1.14.5',
'jupyter',
'pytest>=3.2.2',
'pytest>=3.2.2,<4.0.0',
'docopt',
'pyyaml',
'protobuf>=3.6,<3.7',

10
ml-agents/requirements.txt


tensorflow==1.7.1
Pillow>=4.2.1
matplotlib
numpy>=1.11.0
jupyter
pytest>=3.2.2
docopt
pyyaml
protobuf==3.6.0
grpcio==1.11.0
正在加载...
取消
保存