Skip to content

Commit

Permalink
fix precise BN
Browse files Browse the repository at this point in the history
Summary: It actually did not run

Reviewed By: rbgirshick

Differential Revision: D17900284

fbshipit-source-id: cf9ae95581f0948b3d2ff13e113ea2146d284f93
  • Loading branch information
ppwwyyxx authored and facebook-github-bot committed Oct 14, 2019
1 parent d250fcc commit 0c28c3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
15 changes: 8 additions & 7 deletions detectron2/engine/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,14 @@ def update_stats(self):

def data_loader():
nonlocal num_iter
num_iter += 1
if num_iter % 100 == 0:
self._logger.info(
"Running precise-BN ... {}/{} iterations.".format(num_iter, self._num_iter)
)
# This way we can reuse the same iterator
yield next(self._data_iter)
while True:
num_iter += 1
if num_iter % 100 == 0:
self._logger.info(
"Running precise-BN ... {}/{} iterations.".format(num_iter, self._num_iter)
)
# This way we can reuse the same iterator
yield next(self._data_iter)

with EventStorage(): # capture events in a new storage to discard them
self._logger.info(
Expand Down
9 changes: 5 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ def autodoc_skip_member(app, what, name, obj, skip, options):


def url_resolver(url):
if '.html' not in url:
url = url.replace('../', '')
if ".html" not in url:
url = url.replace("../", "")
return "https://github.com/facebookresearch/detectron2/blob/master/" + url
else:
if DEPLOY:
return "http://detectron2.readthedocs.io/" + url
else:
return '/' + url
return "/" + url


def setup(app):
Expand All @@ -272,7 +272,8 @@ def setup(app):
# app.connect('autodoc-skip-member', autodoc_skip_member)
app.add_config_value(
"recommonmark_config",
{ "url_resolver": url_resolver,
{
"url_resolver": url_resolver,
"auto_toc_tree_section": "Contents",
"enable_math": True,
"enable_inline_math": True,
Expand Down

0 comments on commit 0c28c3d

Please sign in to comment.