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
ResNet50_tensorflow
Commits
7ae6bfdd
Commit
7ae6bfdd
authored
Dec 30, 2019
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Dec 30, 2019
Browse files
PY3 migration. Autograph compatible.
PiperOrigin-RevId: 287619398
parent
0b87b8b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
official/modeling/hyperparams/params_dict.py
official/modeling/hyperparams/params_dict.py
+2
-2
official/modeling/hyperparams/params_dict_test.py
official/modeling/hyperparams/params_dict_test.py
+1
-1
official/vision/detection/dataloader/input_reader.py
official/vision/detection/dataloader/input_reader.py
+1
-1
official/vision/detection/modeling/base_model.py
official/vision/detection/modeling/base_model.py
+1
-1
No files found.
official/modeling/hyperparams/params_dict.py
View file @
7ae6bfdd
...
@@ -111,10 +111,10 @@ class ParamsDict(object):
...
@@ -111,10 +111,10 @@ class ParamsDict(object):
the value of the key.
the value of the key.
Raises:
Raises:
Key
Error: if k is not defined in the ParamsDict.
Attribute
Error: if k is not defined in the ParamsDict.
"""
"""
if
k
not
in
self
.
__dict__
.
keys
():
if
k
not
in
self
.
__dict__
.
keys
():
raise
Key
Error
(
'The key `{}` does not exist. '
.
format
(
k
))
raise
Attribute
Error
(
'The key `{}` does not exist. '
.
format
(
k
))
return
self
.
__dict__
[
k
]
return
self
.
__dict__
[
k
]
def
__contains__
(
self
,
key
):
def
__contains__
(
self
,
key
):
...
...
official/modeling/hyperparams/params_dict_test.py
View file @
7ae6bfdd
...
@@ -27,7 +27,7 @@ class ParamsDictTest(tf.test.TestCase):
...
@@ -27,7 +27,7 @@ class ParamsDictTest(tf.test.TestCase):
def
test_init_from_an_empty_dict
(
self
):
def
test_init_from_an_empty_dict
(
self
):
params
=
params_dict
.
ParamsDict
()
params
=
params_dict
.
ParamsDict
()
with
self
.
assertRaises
(
Key
Error
):
with
self
.
assertRaises
(
Attribute
Error
):
_
=
params
.
a
_
=
params
.
a
with
self
.
assertRaises
(
KeyError
):
with
self
.
assertRaises
(
KeyError
):
...
...
official/vision/detection/dataloader/input_reader.py
View file @
7ae6bfdd
...
@@ -64,7 +64,7 @@ class InputFn(object):
...
@@ -64,7 +64,7 @@ class InputFn(object):
self
.
_input_sharding
=
params
.
train
.
input_sharding
self
.
_input_sharding
=
params
.
train
.
input_sharding
else
:
else
:
self
.
_input_sharding
=
params
.
eval
.
input_sharding
self
.
_input_sharding
=
params
.
eval
.
input_sharding
except
Key
Error
:
except
Attribute
Error
:
pass
pass
def
__call__
(
self
,
ctx
=
None
,
batch_size
:
int
=
None
):
def
__call__
(
self
,
ctx
=
None
,
batch_size
:
int
=
None
):
...
...
official/vision/detection/modeling/base_model.py
View file @
7ae6bfdd
...
@@ -39,7 +39,7 @@ class OptimizerFactory(object):
...
@@ -39,7 +39,7 @@ class OptimizerFactory(object):
nesterov
=
False
nesterov
=
False
try
:
try
:
nesterov
=
params
.
nesterov
nesterov
=
params
.
nesterov
except
Key
Error
:
except
Attribute
Error
:
pass
pass
self
.
_optimizer
=
functools
.
partial
(
self
.
_optimizer
=
functools
.
partial
(
tf
.
keras
.
optimizers
.
SGD
,
tf
.
keras
.
optimizers
.
SGD
,
...
...
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