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
69b68b26
Commit
69b68b26
authored
Nov 05, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #967
parent
fded4f40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
scripts/checkpoint-manipulate.py
scripts/checkpoint-manipulate.py
+3
-3
No files found.
scripts/checkpoint-manipulate.py
View file @
69b68b26
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
numpy
as
np
import
numpy
as
np
from
tensorpack.tfutils.varmanip
import
dump
_chkpt_vars
from
tensorpack.tfutils.varmanip
import
load
_chkpt_vars
from
tensorpack.utils
import
logger
from
tensorpack.utils
import
logger
import
argparse
import
argparse
...
@@ -21,13 +21,13 @@ if __name__ == '__main__':
...
@@ -21,13 +21,13 @@ if __name__ == '__main__':
elif
args
.
model
.
endswith
(
'.npz'
):
elif
args
.
model
.
endswith
(
'.npz'
):
params
=
dict
(
np
.
load
(
args
.
model
))
params
=
dict
(
np
.
load
(
args
.
model
))
else
:
else
:
params
=
dump
_chkpt_vars
(
args
.
model
)
params
=
load
_chkpt_vars
(
args
.
model
)
logger
.
info
(
"Variables in the model:"
)
logger
.
info
(
"Variables in the model:"
)
logger
.
info
(
str
(
params
.
keys
()))
logger
.
info
(
str
(
params
.
keys
()))
if
args
.
dump
:
if
args
.
dump
:
assert
args
.
dump
.
endswith
(
'.npz'
),
args
.
dump
assert
args
.
dump
.
endswith
(
'.npz'
),
args
.
dump
np
.
save
(
args
.
dump
,
**
params
)
np
.
save
z
(
args
.
dump
,
**
params
)
if
args
.
shell
:
if
args
.
shell
:
# params is a dict. play with it
# params is a dict. play with it
...
...
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