Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Matt Harvey
five-video-classification-methods
Commits
aefc4ec7
Commit
aefc4ec7
authored
7 years ago
by
Matt Harvey
Browse files
Options
Download
Email Patches
Plain Diff
Dont freeze the new dense layers.
parent
7653d633
master
add-demo-script
github/fork/Anner-deJong/patch-2
github/fork/ideaRunner/edit_move_file
github/fork/ikvision/master
github/fork/mertia-himanshu/master
github/fork/prabindh/master
github/fork/sanshibayuan/master
playground
playground-add-synthetic
v1.0
1 merge request
!26
Fixes bug where our fine-tuning layers were frozen
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
train_cnn.py
+1
-2
train_cnn.py
with
1 addition
and
2 deletions
+1
-2
train_cnn.py
+
1
-
2
View file @
aefc4ec7
...
...
@@ -74,10 +74,9 @@ def get_model(weights='imagenet'):
def
freeze_all_but_top
(
model
):
"""Used to train just the top layers of the model."""
print
(
model
.
summary
())
# first: train only the top layers (which were randomly initialized)
# i.e. freeze all convolutional InceptionV3 layers
for
layer
in
model
.
layers
:
for
layer
in
model
.
layers
[:
-
2
]
:
layer
.
trainable
=
False
# compile the model (should be done *after* setting layers to non-trainable)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets