当前位置: 首页>>代码示例>>Python>>正文


Python collect_env.get_pretty_env_info方法代码示例

本文整理汇总了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) 
开发者ID:ELEKTRONN,项目名称:elektronn3,代码行数:22,代码来源:trainer.py

示例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 
开发者ID:Res2Net,项目名称:Res2Net-maskrcnn,代码行数:6,代码来源:collect_env.py

示例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 
开发者ID:KaiyangZhou,项目名称:deep-person-reid,代码行数:11,代码来源:tools.py

示例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 
开发者ID:microsoft,项目名称:Relation-Aware-Global-Attention-Networks,代码行数:10,代码来源:osutils.py

示例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() 
开发者ID:facebookresearch,项目名称:detectron2,代码行数:12,代码来源:collect_env.py

示例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 
开发者ID:foolwood,项目名称:SiamMask,代码行数:6,代码来源:train_siamrpn.py


注:本文中的torch.utils.collect_env.get_pretty_env_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。