浏览代码

Import webfiles.zip for Tensorboard

/develop-pyinstaller
Ervin Teng 5 年前
当前提交
dc47efbe
共有 3 个文件被更改,包括 27 次插入10 次删除
  1. 16
      directoryinstall.spec
  2. 10
      execinstall.spec
  3. 11
      ml-agents/mlagents/trainers/learn.py

16
directoryinstall.spec


block_cipher = None
from PyInstaller.utils.hooks import collect_submodules
import os, importlib
hidden_imports = collect_submodules('tensorflow.contrib')
package_imports = [['tensorboard', ['webfiles.zip']]]
added_files = [
( 'config', 'config' ),
( 'demos', 'demos' ),
]
added_files = [( 'config', 'config' ),( 'demos', 'demos' )]
for package, files in package_imports:
proot = os.path.dirname(importlib.import_module(package).__file__)
added_files.extend((os.path.join(proot, f), package) for f in files)
hidden_imports = collect_submodules('tensorflow.contrib')
a = Analysis(['ml-agents/mlagents/trainers/learn.py'],
pathex=['/Users/ervin/Development/ml-agents-develop'],

strip=False,
upx=True,
upx_exclude=[],
name='testonedir')
name='mlagents-dir')

10
execinstall.spec


block_cipher = None
from PyInstaller.utils.hooks import collect_submodules
import os, importlib
package_imports = [['tensorboard', ['webfiles.zip']]]
added_files = []
for package, files in package_imports:
proot = os.path.dirname(importlib.import_module(package).__file__)
added_files.extend((os.path.join(proot, f), package) for f in files)
datas=[],
datas=added_files,
hiddenimports=hidden_imports,
hookspath=[],
runtime_hooks=[],

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


import shutil
import numpy as np
import yaml
import importlib
from docopt import docopt
from typing import Any, Callable, Dict, Optional

tc.start_learning(env)
def get_tensorboard_file_provider():
root_dir = os.path.dirname(importlib.import_module("tensorboard").__file__)
filename = os.path.join(root_dir, "webfiles.zip")
return open(filename, "rb")
tb = program.TensorBoard(
default.get_plugins(), program.get_default_assets_zip_provider()
)
tb = program.TensorBoard(default.get_plugins(), get_tensorboard_file_provider)
tb.configure(argv=[None, "--logdir", "./summaries/"])
url = tb.launch()
print("---------------------------------\n")

正在加载...
取消
保存