Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Swin-Transformer-Object-Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wanggh
Swin-Transformer-Object-Detection
Commits
03e63e5e
Commit
03e63e5e
authored
3 years ago
by
Guo-Hua Wang
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.nju.edu.cn:wanggh/Swin-Transformer-Object-Detection
parents
12152d61
e78febbb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_1x_coco.py
+1
-1
1 addition, 1 deletion
...swin_tiny_patch4_window7_mstrain_480-800_adamw_1x_coco.py
tools/gen_checkpoint.py
+21
-1
21 additions, 1 deletion
tools/gen_checkpoint.py
with
22 additions
and
2 deletions
configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_1x_coco.py
+
1
−
1
View file @
03e63e5e
...
...
@@ -68,7 +68,7 @@ optimizer = dict(_delete_=True, type='AdamW', lr=0.0001, betas=(0.9, 0.999), wei
lr_config
=
dict
(
step
=
[
8
,
11
])
#runner = dict(type='EpochBasedRunnerAmp', max_epochs=12)
runner
=
dict
(
type
=
'
EpochBasedRunner
'
,
max_epochs
=
12
)
# do not use mmdet version fp16
# fp16 = None
# optimizer_config = dict(
...
...
This diff is collapsed.
Click to expand it.
tools/gen_checkpoint.py
+
21
−
1
View file @
03e63e5e
...
...
@@ -29,7 +29,6 @@ def merge(backbone, head):
tsd
=
target
[
'
state_dict
'
]
bsd
=
backbone
[
'
state_dict
'
]
hsd
=
head
[
'
state_dict
'
]
for
key
in
bsd
.
keys
():
if
'
backbone
'
in
key
:
tsd
[
key
]
=
bsd
[
key
]
...
...
@@ -67,6 +66,23 @@ def gen_backbone(backbone, new_backbone):
tsd
[
key
]
=
nbsd
[
nk
]
return
target
def
gen_imagenet_h
(
backbone
,
head
):
target
=
dict
()
target
[
'
state_dict
'
]
=
dict
()
tsd
=
target
[
'
state_dict
'
]
bsd
=
backbone
[
'
model
'
]
hsd
=
head
[
'
state_dict
'
]
for
key
in
hsd
.
keys
():
if
'
backbone
'
not
in
key
:
tsd
[
key
]
=
hsd
[
key
]
else
:
bkey
=
key
[
9
:]
if
bkey
not
in
bsd
:
print
(
"
{} not load
"
.
format
(
key
))
continue
tsd
[
key
]
=
bsd
[
bkey
]
return
target
def
main
():
args
=
parse_args
()
print
(
"
generate checkpoint
"
)
...
...
@@ -80,6 +96,10 @@ def main():
head
=
get_sd
(
args
.
head
,
return_sd
=
False
)
print
(
"
backbone+neck:{} head:{}
"
.
format
(
args
.
backbone_neck
,
args
.
head
))
target
=
merge_bn_h
(
backbone
,
head
)
elif
args
.
new_backbone
and
args
.
head
:
backbone
=
get_sd
(
args
.
new_backbone
,
return_sd
=
False
)
head
=
get_sd
(
args
.
head
,
return_sd
=
False
)
target
=
gen_imagenet_h
(
backbone
,
head
)
elif
args
.
new_backbone
:
backbone
=
get_sd
(
args
.
backbone
,
return_sd
=
False
)
nb
=
get_sd
(
args
.
new_backbone
,
return_sd
=
False
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment