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
OpenDAS
apex
Commits
dcda3b56
"src/vscode:/vscode.git/clone" did not exist on "026841447cd2e143b6d5d2fa9621b3bd1d975e25"
Commit
dcda3b56
authored
Jun 01, 2018
by
Pooya Davoodi
Browse files
Print speed (img/sec) in imagenet example
parent
ea93767d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
examples/imagenet/main.py
examples/imagenet/main.py
+10
-2
No files found.
examples/imagenet/main.py
View file @
dcda3b56
...
@@ -310,11 +310,15 @@ def train(train_loader, model, criterion, optimizer, epoch):
...
@@ -310,11 +310,15 @@ def train(train_loader, model, criterion, optimizer, epoch):
if
args
.
rank
==
0
and
i
%
args
.
print_freq
==
0
and
i
>
1
:
if
args
.
rank
==
0
and
i
%
args
.
print_freq
==
0
and
i
>
1
:
print
(
'Epoch: [{0}][{1}/{2}]
\t
'
print
(
'Epoch: [{0}][{1}/{2}]
\t
'
'Time {batch_time.val:.3f} ({batch_time.avg:.3f})
\t
'
'Time {batch_time.val:.3f} ({batch_time.avg:.3f})
\t
'
'Speed {3:.3f} ({4:.3f})
\t
'
'Data {data_time.val:.3f} ({data_time.avg:.3f})
\t
'
'Data {data_time.val:.3f} ({data_time.avg:.3f})
\t
'
'Loss {loss.val:.4f} ({loss.avg:.4f})
\t
'
'Loss {loss.val:.4f} ({loss.avg:.4f})
\t
'
'Prec@1 {top1.val:.3f} ({top1.avg:.3f})
\t
'
'Prec@1 {top1.val:.3f} ({top1.avg:.3f})
\t
'
'Prec@5 {top5.val:.3f} ({top5.avg:.3f})'
.
format
(
'Prec@5 {top5.val:.3f} ({top5.avg:.3f})'
.
format
(
epoch
,
i
,
len
(
train_loader
),
batch_time
=
batch_time
,
epoch
,
i
,
len
(
train_loader
),
args
.
world_size
*
args
.
batch_size
/
batch_time
.
val
,
args
.
world_size
*
args
.
batch_size
/
batch_time
.
avg
,
batch_time
=
batch_time
,
data_time
=
data_time
,
loss
=
losses
,
top1
=
top1
,
top5
=
top5
))
data_time
=
data_time
,
loss
=
losses
,
top1
=
top1
,
top5
=
top5
))
...
@@ -363,10 +367,14 @@ def validate(val_loader, model, criterion):
...
@@ -363,10 +367,14 @@ def validate(val_loader, model, criterion):
if
args
.
rank
==
0
and
i
%
args
.
print_freq
==
0
:
if
args
.
rank
==
0
and
i
%
args
.
print_freq
==
0
:
print
(
'Test: [{0}/{1}]
\t
'
print
(
'Test: [{0}/{1}]
\t
'
'Time {batch_time.val:.3f} ({batch_time.avg:.3f})
\t
'
'Time {batch_time.val:.3f} ({batch_time.avg:.3f})
\t
'
'Speed {2:.3f} ({3:.3f})
\t
'
'Loss {loss.val:.4f} ({loss.avg:.4f})
\t
'
'Loss {loss.val:.4f} ({loss.avg:.4f})
\t
'
'Prec@1 {top1.val:.3f} ({top1.avg:.3f})
\t
'
'Prec@1 {top1.val:.3f} ({top1.avg:.3f})
\t
'
'Prec@5 {top5.val:.3f} ({top5.avg:.3f})'
.
format
(
'Prec@5 {top5.val:.3f} ({top5.avg:.3f})'
.
format
(
i
,
len
(
val_loader
),
batch_time
=
batch_time
,
loss
=
losses
,
i
,
len
(
val_loader
),
args
.
world_size
*
args
.
batch_size
/
batch_time
.
val
,
args
.
world_size
*
args
.
batch_size
/
batch_time
.
avg
,
batch_time
=
batch_time
,
loss
=
losses
,
top1
=
top1
,
top5
=
top5
))
top1
=
top1
,
top5
=
top5
))
input
,
target
=
prefetcher
.
next
()
input
,
target
=
prefetcher
.
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