Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
ab09215e
You need to sign in or sign up before continuing.
Commit
ab09215e
authored
Dec 01, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dump-model-params with more help message
parent
1fa5ba1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
scripts/dump-model-params.py
scripts/dump-model-params.py
+8
-7
No files found.
scripts/dump-model-params.py
View file @
ab09215e
...
@@ -9,17 +9,18 @@ import tensorflow as tf
...
@@ -9,17 +9,18 @@ import tensorflow as tf
from
tensorpack
import
logger
from
tensorpack
import
logger
from
tensorpack.tfutils
import
varmanip
,
get_model_loader
from
tensorpack.tfutils
import
varmanip
,
get_model_loader
parser
=
argparse
.
ArgumentParser
()
if
__name__
==
'__main__'
:
parser
.
add_argument
(
'--meta'
,
help
=
'metagraph file'
,
required
=
True
)
parser
=
argparse
.
ArgumentParser
(
parser
.
add_argument
(
dest
=
'model'
)
description
=
'Keep only TRAINABLE and MODEL variables in a checkpoint.'
)
parser
.
add_argument
(
dest
=
'output'
)
parser
.
add_argument
(
'--meta'
,
help
=
'metagraph file'
,
required
=
True
)
args
=
parser
.
parse_args
()
parser
.
add_argument
(
dest
=
'input'
,
help
=
'input model file, has to be a TF checkpoint'
)
parser
.
add_argument
(
dest
=
'output'
,
help
=
'output model file, can be npy/npz or TF checkpoint'
)
args
=
parser
.
parse_args
()
with
tf
.
Graph
()
.
as_default
()
as
G
:
tf
.
train
.
import_meta_graph
(
args
.
meta
)
tf
.
train
.
import_meta_graph
(
args
.
meta
)
# loading...
# loading...
init
=
get_model_loader
(
args
.
model
)
init
=
get_model_loader
(
args
.
input
)
sess
=
tf
.
Session
(
config
=
tf
.
ConfigProto
(
allow_soft_placement
=
True
))
sess
=
tf
.
Session
(
config
=
tf
.
ConfigProto
(
allow_soft_placement
=
True
))
sess
.
run
(
tf
.
global_variables_initializer
())
sess
.
run
(
tf
.
global_variables_initializer
())
sess
.
run
(
tf
.
local_variables_initializer
())
sess
.
run
(
tf
.
local_variables_initializer
())
...
...
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