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
6eb4b244
You need to sign in or sign up before continuing.
Commit
6eb4b244
authored
Feb 07, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fallback to tf.contrib.layers.variance_scaling_initializer.
parent
32c83fea
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
7 deletions
+9
-7
README.md
README.md
+1
-1
examples/FasterRCNN/data.py
examples/FasterRCNN/data.py
+0
-1
tensorpack/libinfo.py
tensorpack/libinfo.py
+2
-2
tensorpack/models/conv2d.py
tensorpack/models/conv2d.py
+4
-2
tensorpack/models/fc.py
tensorpack/models/fc.py
+2
-1
No files found.
README.md
View file @
6eb4b244
...
@@ -60,7 +60,7 @@ Dependencies:
...
@@ -60,7 +60,7 @@ Dependencies:
+
Python 2.7 or 3
+
Python 2.7 or 3
+
Python bindings for OpenCV (Optional, but required by a lot of features)
+
Python bindings for OpenCV (Optional, but required by a lot of features)
+
TensorFlow >= 1.
2
.0 (Optional if you only want to use
`tensorpack.dataflow`
alone as a data processing library)
+
TensorFlow >= 1.
3
.0 (Optional if you only want to use
`tensorpack.dataflow`
alone as a data processing library)
```
```
# install git, then:
# install git, then:
pip install -U git+https://github.com/ppwwyyxx/tensorpack.git
pip install -U git+https://github.com/ppwwyyxx/tensorpack.git
...
...
examples/FasterRCNN/data.py
View file @
6eb4b244
...
@@ -208,7 +208,6 @@ def get_train_dataflow(add_mask=False):
...
@@ -208,7 +208,6 @@ def get_train_dataflow(add_mask=False):
changed or skipped accordingly.
changed or skipped accordingly.
"""
"""
# Valid training images should have at least one fg box.
# Valid training images should have at least one fg box.
# But this filter shall not be applied for testing.
# But this filter shall not be applied for testing.
imgs
=
list
(
filter
(
lambda
img
:
len
(
img
[
'boxes'
])
>
0
,
imgs
))
# log invalid training
imgs
=
list
(
filter
(
lambda
img
:
len
(
img
[
'boxes'
])
>
0
,
imgs
))
# log invalid training
...
...
tensorpack/libinfo.py
View file @
6eb4b244
...
@@ -36,8 +36,8 @@ try:
...
@@ -36,8 +36,8 @@ try:
import
tensorflow
as
tf
# noqa
import
tensorflow
as
tf
# noqa
_version
=
tf
.
__version__
.
split
(
'.'
)
_version
=
tf
.
__version__
.
split
(
'.'
)
assert
int
(
_version
[
0
])
>=
1
,
"TF>=1.0 is required!"
assert
int
(
_version
[
0
])
>=
1
,
"TF>=1.0 is required!"
if
int
(
_version
[
1
])
<
2
:
if
int
(
_version
[
1
])
<
3
:
print
(
"TF<1.
2 support will be removed after 2018-02-28!
"
)
print
(
"TF<1.
3 support will be removed after 2018-03-15! Actually many examples already require TF>=1.3.
"
)
_HAS_TF
=
True
_HAS_TF
=
True
except
ImportError
:
except
ImportError
:
_HAS_TF
=
False
_HAS_TF
=
False
...
...
tensorpack/models/conv2d.py
View file @
6eb4b244
...
@@ -60,7 +60,8 @@ def Conv2D(x, out_channel, kernel_shape,
...
@@ -60,7 +60,8 @@ def Conv2D(x, out_channel, kernel_shape,
kw_args
[
'dilations'
]
=
shape4d
(
dilation_rate
,
data_format
=
data_format
)
kw_args
[
'dilations'
]
=
shape4d
(
dilation_rate
,
data_format
=
data_format
)
if
W_init
is
None
:
if
W_init
is
None
:
W_init
=
tf
.
variance_scaling_initializer
(
scale
=
2.0
)
# W_init = tf.variance_scaling_initializer(scale=2.0)
W_init
=
tf
.
contrib
.
layers
.
variance_scaling_initializer
(
2.0
)
if
b_init
is
None
:
if
b_init
is
None
:
b_init
=
tf
.
constant_initializer
()
b_init
=
tf
.
constant_initializer
()
...
@@ -114,7 +115,8 @@ def Deconv2D(x, out_channel, kernel_shape,
...
@@ -114,7 +115,8 @@ def Deconv2D(x, out_channel, kernel_shape,
* ``b``: bias
* ``b``: bias
"""
"""
if
W_init
is
None
:
if
W_init
is
None
:
W_init
=
tf
.
variance_scaling_initializer
(
scale
=
2.0
)
# W_init = tf.variance_scaling_initializer(scale=2.0)
W_init
=
tf
.
contrib
.
layers
.
variance_scaling_initializer
(
2.0
)
if
b_init
is
None
:
if
b_init
is
None
:
b_init
=
tf
.
constant_initializer
()
b_init
=
tf
.
constant_initializer
()
...
...
tensorpack/models/fc.py
View file @
6eb4b244
...
@@ -38,7 +38,8 @@ def FullyConnected(x, out_dim,
...
@@ -38,7 +38,8 @@ def FullyConnected(x, out_dim,
x
=
symbf
.
batch_flatten
(
x
)
x
=
symbf
.
batch_flatten
(
x
)
if
W_init
is
None
:
if
W_init
is
None
:
W_init
=
tf
.
variance_scaling_initializer
(
2.0
)
# W_init = tf.variance_scaling_initializer(2.0)
W_init
=
tf
.
contrib
.
layers
.
variance_scaling_initializer
(
2.0
)
if
b_init
is
None
:
if
b_init
is
None
:
b_init
=
tf
.
constant_initializer
()
b_init
=
tf
.
constant_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