当前位置:网站首页>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
边栏推荐
- 危机即机遇,远程办公效率为何会提升?
- Minecraft 1.12.2模组开发(四十三) 自定义盾牌(Shield)
- CUDA, NVIDIA driver, cudnn download address and version correspondence
- What about laptop Caton? Teach you to reinstall the system with one click to "revive" the computer
- Valueerror: invalid literal for int() with base 10 conversion error related to data type
- 2021-09-02 unity project uses rider to build hot change project failure record of ilruntime
- Google tries to use rust in Chrome
- IOT 设计与开发
- [SQL] string series 2: split a string into multiple lines according to specific characters
- DeNO 1.13.2 release
猜你喜欢
随机推荐
2021-06-29 C escape character cancellation and use
Reference of custom message in ROS function pack failed
Google 尝试在 Chrome 中使用 Rust
Send email to laravel
Addition, deletion, modification and query of advanced MySQL data (DML)
ubutnu20安裝CenterNet
Unit function expansion
Lunch on the 23rd day at home
Is qiniu school useful and is the recommended securities account safe
Summary and effect analysis of methods for calculating binocular parallax
Thinking after learning to type
Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem
ROS学习笔记-----ROS的使用教程
Tensorflow realizes gradient accumulation, and then returns
ros功能包内自定义消息引用失败
Selenium displays webdriverwait
浅谈数据库设计之三大范式
如何发挥测试策略的指导性作用
IOT design and development
中创存储|想要一个好用的分布式存储云盘,到底该怎么选