当前位置:网站首页>Detectron2 usage model
Detectron2 usage model
2022-04-23 21:01:00 【Top of the program】
from Yacs Config Build the model
from yacs Configuration object , Model ( And its sub models ) Can pass build_model、build_backbone、build_roi_heads Equifunction construction :
from detectron2.modeling import build_model
model = build_model(cfg) # returns a torch.nn.Module
build_model Build a random model with only structural parameters . About how to put existing checkpoint Information about loading into the model and how to use the model object , See below .
load / Save checkpoint
from detectron2.checkpoint import DetectionCheckpointer
DetectionCheckpointer(model).load(file_path_or_url) # load a file, usually from cfg.MODEL.WEIGHTS
checkpointer = DetectionCheckpointer(model, save_dir="output")
checkpointer.save("model_999") # save to output/model_999.pth
Detectron2 Checkpoint identification for pytorch Of .pth Format model , And us model zoon Medium .pkl file . More details about its usage , see also API file .
have access to torch.{load,save} Yes .pth File or pickle.{dump,load} Yes .pkl File arbitrary operation .
版权声明
本文为[Top of the program]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/111/202204210545090198.html
边栏推荐
- Preliminary analysis of Airbase
- MySQL进阶之数据的增删改查(DML)
- Fastdfs思维导图
- Question brushing plan -- backtracking method (I)
- presto on spark 支持3.1.3记录
- 41. The first missing positive number
- Common commands of MySQL in Linux
- Addition, deletion, modification and query of advanced MySQL data (DML)
- 又一款数据分析神器:Polars 真的很强大
- ubutnu20安装CenterNet
猜你喜欢
Lunch on the 23rd day at home
GSI-ECM工程建设管理数字化平台
Problem brushing plan -- dynamic programming (III)
Fastdfs mind map
3-5 obtaining cookies through XSS and the use of XSS background management system
Minecraft 1.12.2模组开发(四十三) 自定义盾牌(Shield)
C, print the source program of beautiful bell triangle
2.整理华子面经--2
Question brushing plan - depth first search DFS (I)
随机推荐
matplotlib. Pyplot partition drawing
Matlab: psychtoolbox installation
Sequential state
Presto on spark supports 3.1.3 records
An error occurs when the addressable assets system project is packaged. Runtimedata is null
学会打字后的思考
Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem
Reference of custom message in ROS function pack failed
Recommended usage scenarios and production tools for common 60 types of charts
DeNO 1.13.2 release
Norm normalization in tensorflow and pytorch of records
100天拿下11K,转岗测试的超全学习指南
Go limit depth traversal of files in directory
ros功能包内自定义消息引用失败
Is rust more suitable for less experienced programmers?
深入探究ASP.NET Core读取Request.Body的正确方式
引入结构化并发,Swift 5.5 发布!
Xiaomi mobile phone has abandoned the "Mi" brand all over the world and switched to the full name brand of "Xiaomi"
2. Finishing huazi Mianjing -- 2
Bracket matching -- [implementation of one-dimensional array]