浏览代码

Consistent string style in trainer_controller.py (#1177)

* Consistent string style in trainer_controller.py.

* Linting error in doc.
/develop-generalizationTraining-TrainerController
GitHub 6 年前
当前提交
6b04b516
共有 2 个文件被更改,包括 30 次插入28 次删除
  1. 11
      docs/Installation-Windows.md
  2. 47
      ml-agents/mlagents/trainers/trainer_controller.py

11
docs/Installation-Windows.md


</p>
Once you've signed up, go back to the cuDNN
[downloads page](https://developer.nvidia.com/cudnn). You may or may not be asked to fill
out a short survey. When you get to the list cuDNN releases, __make sure you are
downloading the right version for the CUDA toolkit you installed in Step 1.__
In this guide, we are using version 7.0.5 for CUDA toolkit version 9.0 ([direct
link](https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.0.5/prod/9.0_20171129/cudnn-9.0-windows10-x64-v7)).
[downloads page](https://developer.nvidia.com/cudnn).
You may or may not be asked to fill out a short survey. When you get to the list
cuDNN releases, __make sure you are downloading the right version for the CUDA
toolkit you installed in Step 1.__ In this guide, we are using version 7.0.5 for
CUDA toolkit version 9.0
([direct link](https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.0.5/prod/9.0_20171129/cudnn-9.0-windows10-x64-v7)).
After you have downloaded the cuDNN files, you will need to extract the files
into the CUDA toolkit directory. In the cuDNN zip file, there are three folders

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


self.summaries_dir = '/{docker_target_name}/summaries'.format(
docker_target_name=docker_target_name)
self.logger = logging.getLogger("mlagents.envs")
self.logger = logging.getLogger('mlagents.envs')
self.run_id = run_id
self.save_freq = save_freq
self.lesson = lesson

raise MetaCurriculumError('One of the curriculums '
'defined in ' +
self.curriculum_folder + ' '
'does not have a corresponding '
'Brain. Check that the '
'curriculum file has the same '
'name as the Brain '
'whose curriculum it defines.')
'does not have a corresponding '
'Brain. Check that the '
'curriculum file has the same '
'name as the Brain '
'whose curriculum it defines.')
def _get_measure_vals(self):
if self.meta_curriculum:

if scope == '/':
scope = ''
scopes += [scope]
if self.trainers[brain_name].parameters["trainer"] \
== "imitation":
nodes += [scope + x for x in ["action"]]
if self.trainers[brain_name].parameters['trainer'] \
== 'imitation':
nodes += [scope + x for x in ['action']]
nodes += [scope + x for x in ["action", "value_estimate",
"action_probs", "value_estimate"]]
if self.trainers[brain_name].parameters["use_recurrent"]:
nodes += [scope + x for x in ["recurrent_out",
"memory_size"]]
nodes += [scope + x for x in ['action', 'value_estimate',
'action_probs',
'value_estimate']]
if self.trainers[brain_name].parameters['use_recurrent']:
nodes += [scope + x for x in ['recurrent_out',
'memory_size']]
self.logger.info("List of available scopes :")
self.logger.info('List of available scopes :')
self.logger.info("\t" + scope)
self.logger.info("List of nodes to export :")
self.logger.info('\t' + scope)
self.logger.info('List of nodes to export :')
self.logger.info("\t" + n)
self.logger.info('\t' + n)
return nodes
def _save_model(self, sess, saver, steps=0):

saver.save(sess, last_checkpoint)
tf.train.write_graph(sess.graph_def, self.model_path,
'raw_graph_def.pb', as_text=False)
self.logger.info("Saved Model")
self.logger.info('Saved Model')
def _export_graph(self):
"""

input_binary=True,
input_checkpoint=ckpt.model_checkpoint_path,
output_node_names=target_nodes,
output_graph=(self.model_path + '/' + self.env_name + "_"
output_graph=(self.model_path + '/' + self.env_name + '_'
clear_devices=True, initializer_nodes="", input_saver="",
restore_op_name="save/restore_all",
filename_tensor_name="save/Const:0")
clear_devices=True, initializer_nodes='', input_saver='',
restore_op_name='save/restore_all',
filename_tensor_name='save/Const:0')
def _initialize_trainers(self, trainer_config, sess):
trainer_parameters_dict = {}

正在加载...
取消
保存