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
2659c4e9
"docs/vscode:/vscode.git/clone" did not exist on "5b9eacdf1bd093243cbe4d473825dcdd8682ffff"
Commit
2659c4e9
authored
Aug 02, 2022
by
Chaochao Yan
Committed by
A. Unique TensorFlower
Aug 02, 2022
Browse files
Internal change
PiperOrigin-RevId: 464827311
parent
cfef35b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
official/projects/yt8m/modeling/yt8m_model.py
official/projects/yt8m/modeling/yt8m_model.py
+3
-2
official/projects/yt8m/tasks/yt8m_task.py
official/projects/yt8m/tasks/yt8m_task.py
+0
-8
No files found.
official/projects/yt8m/modeling/yt8m_model.py
View file @
2659c4e9
...
@@ -85,8 +85,9 @@ class DbofModel(tf.keras.Model):
...
@@ -85,8 +85,9 @@ class DbofModel(tf.keras.Model):
feature_size
=
input_specs
.
shape
[
-
1
]
feature_size
=
input_specs
.
shape
[
-
1
]
# shape 'excluding' batch_size
# shape 'excluding' batch_size
model_input
=
tf
.
keras
.
Input
(
shape
=
self
.
_input_specs
.
shape
[
1
:])
model_input
=
tf
.
keras
.
Input
(
shape
=
self
.
_input_specs
.
shape
[
1
:])
tf
.
summary
.
histogram
(
"input_hist"
,
model_input
)
# normalize input features
input_data
=
model_input
input_data
=
tf
.
nn
.
l2_normalize
(
model_input
,
-
1
)
tf
.
summary
.
histogram
(
"input_hist"
,
input_data
)
# configure model
# configure model
if
params
.
add_batch_norm
:
if
params
.
add_batch_norm
:
...
...
official/projects/yt8m/tasks/yt8m_task.py
View file @
2659c4e9
...
@@ -168,10 +168,6 @@ class YT8MTask(base_task.Task):
...
@@ -168,10 +168,6 @@ class YT8MTask(base_task.Task):
features
,
labels
=
inputs
[
'video_matrix'
],
inputs
[
'labels'
]
features
,
labels
=
inputs
[
'video_matrix'
],
inputs
[
'labels'
]
num_frames
=
inputs
[
'num_frames'
]
num_frames
=
inputs
[
'num_frames'
]
# Normalize input features.
feature_dim
=
len
(
features
.
shape
)
-
1
features
=
tf
.
nn
.
l2_normalize
(
features
,
feature_dim
)
# sample random frames / random sequence
# sample random frames / random sequence
num_frames
=
tf
.
cast
(
num_frames
,
tf
.
float32
)
num_frames
=
tf
.
cast
(
num_frames
,
tf
.
float32
)
sample_frames
=
self
.
task_config
.
train_data
.
num_frames
sample_frames
=
self
.
task_config
.
train_data
.
num_frames
...
@@ -244,10 +240,6 @@ class YT8MTask(base_task.Task):
...
@@ -244,10 +240,6 @@ class YT8MTask(base_task.Task):
features
,
labels
=
inputs
[
'video_matrix'
],
inputs
[
'labels'
]
features
,
labels
=
inputs
[
'video_matrix'
],
inputs
[
'labels'
]
num_frames
=
inputs
[
'num_frames'
]
num_frames
=
inputs
[
'num_frames'
]
# Normalize input features.
feature_dim
=
len
(
features
.
shape
)
-
1
features
=
tf
.
nn
.
l2_normalize
(
features
,
feature_dim
)
# sample random frames (None, 5, 1152) -> (None, 30, 1152)
# sample random frames (None, 5, 1152) -> (None, 30, 1152)
sample_frames
=
self
.
task_config
.
validation_data
.
num_frames
sample_frames
=
self
.
task_config
.
validation_data
.
num_frames
if
self
.
task_config
.
model
.
sample_random_frames
:
if
self
.
task_config
.
model
.
sample_random_frames
:
...
...
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