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
yolov5_pytorch
Commits
680f7a8b
Commit
680f7a8b
authored
Oct 23, 2023
by
Sugon_ldc
Browse files
add torch.backends.cudnn.benchmark=True in files
parent
ec05729b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
train.py
train.py
+1
-0
No files found.
train.py
View file @
680f7a8b
...
@@ -287,6 +287,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
...
@@ -287,6 +287,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
if
RANK
in
[
-
1
,
0
]:
if
RANK
in
[
-
1
,
0
]:
pbar
=
tqdm
(
pbar
,
total
=
nb
)
# progress bar
pbar
=
tqdm
(
pbar
,
total
=
nb
)
# progress bar
optimizer
.
zero_grad
()
optimizer
.
zero_grad
()
torch
.
backends
.
cudnn
.
benchmark
=
True
for
i
,
(
imgs
,
targets
,
paths
,
_
)
in
pbar
:
# batch -------------------------------------------------------------
for
i
,
(
imgs
,
targets
,
paths
,
_
)
in
pbar
:
# batch -------------------------------------------------------------
ni
=
i
+
nb
*
epoch
# number integrated batches (since train start)
ni
=
i
+
nb
*
epoch
# number integrated batches (since train start)
imgs
=
imgs
.
to
(
device
,
non_blocking
=
True
).
float
()
/
255.0
# uint8 to float32, 0-255 to 0.0-1.0
imgs
=
imgs
.
to
(
device
,
non_blocking
=
True
).
float
()
/
255.0
# uint8 to float32, 0-255 to 0.0-1.0
...
...
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