Py之fvcore:fvcore库的简介、安装、使用方法之详细攻略
【摘要】 Py之fvcore:fvcore库的简介、安装、使用方法之详细攻略
目录
fvcore库的简介
fvcore库的安装
fvcore库的使用方法
1、基础用法
fvcore库的简介
fvcore是一个轻量级的核心库,它提供了在各种计算机视觉框架...
Py之fvcore:fvcore库的简介、安装、使用方法之详细攻略
目录
fvcore库的简介
fvcore是一个轻量级的核心库,它提供了在各种计算机视觉框架(如Detectron2)中共享的最常见和最基本的功能。这个库基于Python 3.6+和PyTorch。这个库中的所有组件都经过了类型注释、测试和基准测试。Facebook 的人工智能实验室即FAIR的计算机视觉组负责维护这个库。
github地址:https://github.com/facebookresearch/fvcore
fvcore库的安装
pip install -U 'git+https://github.com/facebookresearch/fvcore'

fvcore库的使用方法
1、基础用法
-
"""Configs."""
-
from fvcore.common.config import CfgNode
-
-
# -----------------------------------------------------------------------------
-
# Config definition
-
# -----------------------------------------------------------------------------
-
_C = CfgNode()
-
-
-
# ---------------------------------------------------------------------------- #
-
# Batch norm options
-
# ---------------------------------------------------------------------------- #
-
_C.BN = CfgNode()
-
-
# BN epsilon.
-
_C.BN.EPSILON = 1e-5
-
-
# BN momentum.
-
_C.BN.MOMENTUM = 0.1
-
-
# Precise BN stats.
-
_C.BN.USE_PRECISE_STATS = False
-
-
# Number of samples use to compute precise bn.
-
_C.BN.NUM_BATCHES_PRECISE = 200
-
-
# Weight decay value that applies on BN.
-
_C.BN.WEIGHT_DECAY = 0.0
-
-
-
# ---------------------------------------------------------------------------- #
-
# Training options.
-
# ---------------------------------------------------------------------------- #
-
_C.TRAIN = CfgNode()
-
-
# If True Train the model, else skip training.
-
_C.TRAIN.ENABLE = True
-
-
# Dataset.
-
_C.TRAIN.DATASET = "kinetics"
-
-
# Total mini-batch size.
-
_C.TRAIN.BATCH_SIZE = 64
-
-
# Evaluate model on test data every eval period epochs.
-
_C.TRAIN.EVAL_PERIOD = 1
-
-
# Save model checkpoint every checkpoint period epochs.
-
_C.TRAIN.CHECKPOINT_PERIOD = 1
-
-
# Resume training from the latest checkpoint in the output directory.
-
_C.TRAIN.AUTO_RESUME = True
-
-
# Path to the checkpoint to load the initial weight.
-
_C.TRAIN.CHECKPOINT_FILE_PATH = ""
-
-
# Checkpoint types include `caffe2` or `pytorch`.
-
_C.TRAIN.CHECKPOINT_TYPE = "pytorch"
-
-
# If True, perform inflation when loading checkpoint.
-
_C.TRAIN.CHECKPOINT_INFLATE = False
文章来源: yunyaniu.blog.csdn.net,作者:一个处女座的程序猿,版权归原作者所有,如需转载,请联系作者。
原文链接:yunyaniu.blog.csdn.net/article/details/103881195
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)