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
MMCV
Commits
65a60a3d
Unverified
Commit
65a60a3d
authored
Oct 26, 2020
by
Rui Xu
Committed by
GitHub
Oct 26, 2020
Browse files
fix iter-time-hook bug when meeting iter-based runner (#623)
parent
c8146cc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mmcv/runner/iter_based_runner.py
mmcv/runner/iter_based_runner.py
+2
-2
No files found.
mmcv/runner/iter_based_runner.py
View file @
65a60a3d
...
...
@@ -55,8 +55,8 @@ class IterBasedRunner(BaseRunner):
self
.
mode
=
'train'
self
.
data_loader
=
data_loader
self
.
_epoch
=
data_loader
.
epoch
self
.
call_hook
(
'before_train_iter'
)
data_batch
=
next
(
data_loader
)
self
.
call_hook
(
'before_train_iter'
)
outputs
=
self
.
model
.
train_step
(
data_batch
,
self
.
optimizer
,
**
kwargs
)
if
not
isinstance
(
outputs
,
dict
):
raise
TypeError
(
'model.train_step() must return a dict'
)
...
...
@@ -71,8 +71,8 @@ class IterBasedRunner(BaseRunner):
self
.
model
.
eval
()
self
.
mode
=
'val'
self
.
data_loader
=
data_loader
self
.
call_hook
(
'before_val_iter'
)
data_batch
=
next
(
data_loader
)
self
.
call_hook
(
'before_val_iter'
)
outputs
=
self
.
model
.
val_step
(
data_batch
,
**
kwargs
)
if
not
isinstance
(
outputs
,
dict
):
raise
TypeError
(
'model.val_step() must return a dict'
)
...
...
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