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
2f3666ed
Commit
2f3666ed
authored
Jun 27, 2017
by
Duc Nguyen
Committed by
GitHub
Jun 27, 2017
Browse files
Change key of type 'tuple' to 'str'
dictionary having both 'tuple' and 'str' keys cannot be 'sorted'
parent
9b187704
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
object_detection/core/batcher.py
object_detection/core/batcher.py
+5
-3
No files found.
object_detection/core/batcher.py
View file @
2f3666ed
...
...
@@ -20,6 +20,8 @@ import tensorflow as tf
from
object_detection.core
import
prefetcher
rt_shape_str
=
'_runtime_shapes'
class
BatchQueue
(
object
):
"""BatchQueue class.
...
...
@@ -81,7 +83,7 @@ class BatchQueue(object):
{
key
:
tensor
.
get_shape
()
for
key
,
tensor
in
tensor_dict
.
iteritems
()})
# Remember runtime shapes to unpad tensors after batching.
runtime_shapes
=
collections
.
OrderedDict
(
{(
key
+
'_runtime
_shape
s'
):
tf
.
shape
(
tensor
)
{(
key
+
rt
_shape
_str
):
tf
.
shape
(
tensor
)
for
key
,
tensor
in
tensor_dict
.
iteritems
()})
all_tensors
=
tensor_dict
all_tensors
.
update
(
runtime_shapes
)
...
...
@@ -112,8 +114,8 @@ class BatchQueue(object):
for
key
,
batched_tensor
in
batched_tensors
.
iteritems
():
unbatched_tensor_list
=
tf
.
unstack
(
batched_tensor
)
for
i
,
unbatched_tensor
in
enumerate
(
unbatched_tensor_list
):
if
'_runtime
_shape
s'
in
key
:
shapes
[(
key
[:
-
15
],
i
)]
=
unbatched_tensor
if
rt
_shape
_str
in
key
:
shapes
[(
key
[:
-
len
(
rt_shape_str
)
],
i
)]
=
unbatched_tensor
else
:
tensors
[(
key
,
i
)]
=
unbatched_tensor
...
...
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