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
73b5be67
Commit
73b5be67
authored
May 26, 2020
by
Allen Wang
Committed by
A. Unique TensorFlower
May 26, 2020
Browse files
Modify `augment.transform` to use `tf.rank` rather than `len(shape)`.
PiperOrigin-RevId: 313259032
parent
986b0825
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
official/vision/image_classification/augment.py
official/vision/image_classification/augment.py
+1
-1
No files found.
official/vision/image_classification/augment.py
View file @
73b5be67
...
@@ -169,7 +169,7 @@ def transform(image: tf.Tensor, transforms) -> tf.Tensor:
...
@@ -169,7 +169,7 @@ def transform(image: tf.Tensor, transforms) -> tf.Tensor:
"""Prepares input data for `image_ops.transform`."""
"""Prepares input data for `image_ops.transform`."""
original_ndims
=
tf
.
rank
(
image
)
original_ndims
=
tf
.
rank
(
image
)
transforms
=
tf
.
convert_to_tensor
(
transforms
,
dtype
=
tf
.
float32
)
transforms
=
tf
.
convert_to_tensor
(
transforms
,
dtype
=
tf
.
float32
)
if
len
(
tf
.
shape
(
transforms
)
)
==
1
:
if
tf
.
rank
(
transforms
)
==
1
:
transforms
=
transforms
[
None
]
transforms
=
transforms
[
None
]
image
=
to_4d
(
image
)
image
=
to_4d
(
image
)
image
=
image_ops
.
transform
(
image
=
image_ops
.
transform
(
...
...
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