Py之fvcore:fvcore库的简介、安装、使用方法之详细攻略
生活随笔
收集整理的這篇文章主要介紹了
Py之fvcore:fvcore库的简介、安装、使用方法之详细攻略
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Py之fvcore:fvcore庫的簡介、安裝、使用方法之詳細(xì)攻略
?
?
目錄
fvcore庫的簡介
fvcore庫的安裝
fvcore庫的使用方法
1、基礎(chǔ)用法
?
?
fvcore庫的簡介
? ? ? ? fvcore是一個(gè)輕量級(jí)的核心庫,它提供了在各種計(jì)算機(jī)視覺框架(如Detectron2)中共享的最常見和最基本的功能。這個(gè)庫基于Python 3.6+和PyTorch。這個(gè)庫中的所有組件都經(jīng)過了類型注釋、測試和基準(zhǔn)測試。Facebook 的人工智能實(shí)驗(yàn)室即FAIR的計(jì)算機(jī)視覺組負(fù)責(zé)維護(hù)這個(gè)庫。
github地址:https://github.com/facebookresearch/fvcore
?
?
fvcore庫的安裝
pip install -U 'git+https://github.com/facebookresearch/fvcore'
?
fvcore庫的使用方法
1、基礎(chǔ)用法
"""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?
?
?
?
?
?
?
?
?
?
總結(jié)
以上是生活随笔為你收集整理的Py之fvcore:fvcore库的简介、安装、使用方法之详细攻略的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Py之simplejson:simple
- 下一篇: IDE之VS:利用 Visual Stu