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
27ba042b
Commit
27ba042b
authored
Apr 21, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs and fix build
parent
b5ca3021
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
docs/tutorial/trainer.md
docs/tutorial/trainer.md
+9
-6
tensorpack/dataflow/serialize.py
tensorpack/dataflow/serialize.py
+3
-1
No files found.
docs/tutorial/trainer.md
View file @
27ba042b
...
...
@@ -45,15 +45,18 @@ The tower function needs to follow some rules:
*
(Recommended) Put non-trainable variables that need to be used in inference into
`MODEL_VARIABLES`
.
3.
It must __respect variable scope names__:
The name of any trainable variables created in the function must be like "variable_scope_name/
custom/scopes
/name".
Therefore
, the name of any trainable variables must:
The name of any trainable variables created in the function must be like "variable_scope_name/
other/scopes/and
/name".
Strictly speaking
, the name of any trainable variables must:
* Start with the name of the enclosing variable_scope when the tower function is called.
* Not use the same variable_scope's name twice in its name.
* Not depend on name_scope's name.
* Not depend on some tensor's name.
* Not use the same variable_scope's name twice.
* Not depend on any tensor's name (because the tensor's name may depend on name_scope's name).
Tensorpack layers create variables based on the name given to the layer (i.e., `Conv2D('name', x)`).
So the name of the layer needs to follow the above rules as well.
Tensorpack layers create variables based on the name given to the layer:
e.g., `Conv2D('test', x)` will open a variable scope named "test".
In order to respect the above rules,
the name of the layer must not depend on name_scope's name or any tensor's name.
4.
It must __respect variable scope reuse__:
*
The creation of any trainable variables must __respect reuse__ variable scope.
To respect variable reuse (i.e. sharing), use
`tf.get_variable`
instead of
`tf.Variable`
in the function.
...
...
tensorpack/dataflow/serialize.py
View file @
27ba042b
...
...
@@ -108,7 +108,9 @@ class NumpySerializer():
@
staticmethod
def
load
(
path
,
shuffle
=
True
):
buffer
=
np
.
load
(
path
)[
'buffer'
]
# allow_pickle defaults to False since numpy 1.16.3
# (https://www.numpy.org/devdocs/release.html#unpickling-while-loading-requires-explicit-opt-in)
buffer
=
np
.
load
(
path
,
allow_pickle
=
True
)[
'buffer'
]
return
DataFromList
(
buffer
,
shuffle
=
shuffle
)
...
...
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