本文整理汇总了Python中torch.utils.collect_env.get_pretty_env_info方法的典型用法代码示例。如果您正苦于以下问题:Python collect_env.get_pretty_env_info方法的具体用法?Python collect_env.get_pretty_env_info怎么用?Python collect_env.get_pretty_env_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类torch.utils.collect_env
的用法示例。
在下文中一共展示了collect_env.get_pretty_env_info方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: archive_backup
# 需要导入模块: from torch.utils import collect_env [as 别名]
# 或者: from torch.utils.collect_env import get_pretty_env_info [as 别名]
def archive_backup(self):
"""Archiving the source folder, the training script and environment info.
The training script is saved with the prefix "0-" to distinguish from regular scripts.
Environment information equivalent to the output of ``python -m torch.utils.collect_env``
is saved in a file named "env_info.txt".
"""
# Archiving the Training script
shutil.copyfile(self.script_path, self.save_path + '/0-' + os.path.basename(self.script_path))
os.chmod(self.save_path + '/0-' + os.path.basename(self.script_path), 0o755)
# Archiving the src folder
pkg_path = os.path.dirname(arch_src)
backup_path = os.path.join(self.save_path, 'src_backup')
shutil.make_archive(backup_path, 'gztar', pkg_path)
# Archiving the Environment Info
env_info = collect_env.get_pretty_env_info()
with open(self.save_path + '/env_info.txt', 'w') as f:
f.write(env_info)
示例2: collect_env_info
# 需要导入模块: from torch.utils import collect_env [as 别名]
# 或者: from torch.utils.collect_env import get_pretty_env_info [as 别名]
def collect_env_info():
env_str = get_pretty_env_info()
env_str += get_pil_version()
return env_str
示例3: collect_env_info
# 需要导入模块: from torch.utils import collect_env [as 别名]
# 或者: from torch.utils.collect_env import get_pretty_env_info [as 别名]
def collect_env_info():
"""Returns env info as a string.
Code source: github.com/facebookresearch/maskrcnn-benchmark
"""
from torch.utils.collect_env import get_pretty_env_info
env_str = get_pretty_env_info()
env_str += '\n Pillow ({})'.format(PIL.__version__)
return env_str
示例4: collect_env_info
# 需要导入模块: from torch.utils import collect_env [as 别名]
# 或者: from torch.utils.collect_env import get_pretty_env_info [as 别名]
def collect_env_info():
"""Returns env info as a string.
Code source: github.com/facebookresearch/maskrcnn-benchmark
"""
from torch.utils.collect_env import get_pretty_env_info
env_str = get_pretty_env_info()
env_str += '\n Pillow ({})'.format(PIL.__version__)
return env_str
示例5: collect_torch_env
# 需要导入模块: from torch.utils import collect_env [as 别名]
# 或者: from torch.utils.collect_env import get_pretty_env_info [as 别名]
def collect_torch_env():
try:
import torch.__config__
return torch.__config__.show()
except ImportError:
# compatible with older versions of pytorch
from torch.utils.collect_env import get_pretty_env_info
return get_pretty_env_info()
示例6: collect_env_info
# 需要导入模块: from torch.utils import collect_env [as 别名]
# 或者: from torch.utils.collect_env import get_pretty_env_info [as 别名]
def collect_env_info():
env_str = get_pretty_env_info()
env_str += "\n OpenCV ({})".format(cv2.__version__)
return env_str