Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
RT-DETR_pytorch
Commits
46260e34
Commit
46260e34
authored
Nov 28, 2024
by
suily
Browse files
Initial commit
parents
Pipeline
#2006
failed with stages
in 0 seconds
Changes
81
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
rtdetr_pytorch/tools/train.py
rtdetr_pytorch/tools/train.py
+48
-0
No files found.
rtdetr_pytorch/tools/train.py
0 → 100644
View file @
46260e34
"""by lyuwenyu
"""
import
os
import
sys
sys
.
path
.
insert
(
0
,
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'..'
))
import
argparse
import
src.misc.dist
as
dist
from
src.core
import
YAMLConfig
from
src.solver
import
TASKS
def
main
(
args
,
)
->
None
:
'''main
'''
dist
.
init_distributed
()
assert
not
all
([
args
.
tuning
,
args
.
resume
]),
\
'Only support from_scrach or resume or tuning at one time'
cfg
=
YAMLConfig
(
args
.
config
,
resume
=
args
.
resume
,
use_amp
=
args
.
amp
,
tuning
=
args
.
tuning
)
solver
=
TASKS
[
cfg
.
yaml_cfg
[
'task'
]](
cfg
)
if
args
.
test_only
:
solver
.
val
()
else
:
solver
.
fit
()
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'--config'
,
'-c'
,
type
=
str
,
)
parser
.
add_argument
(
'--resume'
,
'-r'
,
type
=
str
,
)
parser
.
add_argument
(
'--tuning'
,
'-t'
,
type
=
str
,
)
parser
.
add_argument
(
'--test-only'
,
action
=
'store_true'
,
default
=
False
,)
parser
.
add_argument
(
'--amp'
,
action
=
'store_true'
,
default
=
False
,)
args
=
parser
.
parse_args
()
main
(
args
)
Prev
1
2
3
4
5
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment