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
460addf8
Commit
460addf8
authored
Apr 01, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add layer tests to travis
parent
eaec5b2b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
14 deletions
+15
-14
.travis.yml
.travis.yml
+2
-2
setup.py
setup.py
+1
-1
tensorpack/models/image_sample.py
tensorpack/models/image_sample.py
+1
-1
tensorpack/models/pool.py
tensorpack/models/pool.py
+10
-9
tests/case_script.py
tests/case_script.py
+1
-1
No files found.
.travis.yml
View file @
460addf8
...
@@ -35,7 +35,7 @@ matrix:
...
@@ -35,7 +35,7 @@ matrix:
install
:
install
:
-
pip install -U pip
# the pip version on travis is too old
-
pip install -U pip
# the pip version on travis is too old
-
pip install flake8 opencv-python pypandoc
-
pip install flake8
scikit-image
opencv-python pypandoc
# here we use opencv-python, but users are in general not recommended to use this package,
# here we use opencv-python, but users are in general not recommended to use this package,
# because it brings issues working with tensorflow on gpu
# because it brings issues working with tensorflow on gpu
-
./tests/install-tensorflow.sh
-
./tests/install-tensorflow.sh
...
@@ -51,7 +51,7 @@ script:
...
@@ -51,7 +51,7 @@ script:
-
cd examples && flake8 .
-
cd examples && flake8 .
-
mkdir -p $HOME/tensorpack_data
-
mkdir -p $HOME/tensorpack_data
-
export TENSORPACK_DATASET=$HOME/tensorpack_data
-
export TENSORPACK_DATASET=$HOME/tensorpack_data
-
cd $TRAVIS_BUILD_DIR/tests && python -m unittest discover -v
-
$TRAVIS_BUILD_DIR/tests/run-tests.sh
notifications
:
notifications
:
-
email
:
-
email
:
...
...
setup.py
View file @
460addf8
...
@@ -43,7 +43,7 @@ setup(
...
@@ -43,7 +43,7 @@ setup(
description
=
'Neural Network Toolbox on TensorFlow'
,
description
=
'Neural Network Toolbox on TensorFlow'
,
long_description
=
long_description
,
long_description
=
long_description
,
install_requires
=
req
,
install_requires
=
req
,
tests_require
=
[
'flake8'
],
tests_require
=
[
'flake8'
,
'scikit-image'
],
extras_require
=
{
extras_require
=
{
'all'
:
extra_req
'all'
:
extra_req
},
},
...
...
tensorpack/models/image_sample.py
View file @
460addf8
...
@@ -107,7 +107,7 @@ def ImageSample(inputs, borderMode='repeat'):
...
@@ -107,7 +107,7 @@ def ImageSample(inputs, borderMode='repeat'):
class
TestSample
(
TestModel
):
class
TestSample
(
TestModel
):
def
test_
s
ample
(
self
):
def
test_
ImageS
ample
(
self
):
import
numpy
as
np
import
numpy
as
np
h
,
w
=
3
,
4
h
,
w
=
3
,
4
...
...
tensorpack/models/pool.py
View file @
460addf8
...
@@ -193,8 +193,7 @@ def BilinearUpSample(x, shape):
...
@@ -193,8 +193,7 @@ def BilinearUpSample(x, shape):
class
TestPool
(
TestModel
):
class
TestPool
(
TestModel
):
def
test_FixedUnPooling
(
self
):
def
test_fixed_unpooling
(
self
):
h
,
w
=
3
,
4
h
,
w
=
3
,
4
mat
=
np
.
random
.
rand
(
h
,
w
,
3
)
.
astype
(
'float32'
)
mat
=
np
.
random
.
rand
(
h
,
w
,
3
)
.
astype
(
'float32'
)
inp
=
self
.
make_variable
(
mat
)
inp
=
self
.
make_variable
(
mat
)
...
@@ -210,7 +209,7 @@ class TestPool(TestModel):
...
@@ -210,7 +209,7 @@ class TestPool(TestModel):
res
[
0
,
::
2
,
::
2
,
:]
=
0
res
[
0
,
::
2
,
::
2
,
:]
=
0
self
.
assertTrue
((
res
==
0
)
.
all
())
self
.
assertTrue
((
res
==
0
)
.
all
())
def
test_
ups
ample
(
self
):
def
test_
BilinearUpS
ample
(
self
):
h
,
w
=
5
,
5
h
,
w
=
5
,
5
scale
=
2
scale
=
2
...
@@ -222,14 +221,16 @@ class TestPool(TestModel):
...
@@ -222,14 +221,16 @@ class TestPool(TestModel):
res
=
self
.
run_variable
(
output
)[
0
,
:,
:,
0
]
res
=
self
.
run_variable
(
output
)[
0
,
:,
:,
0
]
from
skimage.transform
import
rescale
from
skimage.transform
import
rescale
res2
=
rescale
(
mat
,
scale
)
res2
=
rescale
(
mat
,
scale
,
mode
=
'constant'
)
diff
=
np
.
abs
(
res2
-
res
)
diff
=
np
.
abs
(
res2
-
res
)
# not equivalent to rescale on edge?
#
TODO
not equivalent to rescale on edge?
diff
[
0
,
:]
=
0
diff
[
0
,
:]
=
0
diff
[
-
1
,
:]
=
0
diff
[:,
0
]
=
0
diff
[:,
0
]
=
0
if
not
diff
.
max
()
<
1e-4
:
diff
[:,
-
1
]
=
0
import
IPython
# if not diff.max() < 1e-4:
IPython
.
embed
(
config
=
IPython
.
terminal
.
ipapp
.
load_default_config
())
# import IPython
self
.
assertTrue
(
diff
.
max
()
<
1e-4
)
# IPython.embed(config=IPython.terminal.ipapp.load_default_config())
self
.
assertTrue
(
diff
.
max
()
<
1e-4
,
diff
.
max
())
tests/case_script.py
View file @
460addf8
...
@@ -52,7 +52,7 @@ class PythonScript(threading.Thread):
...
@@ -52,7 +52,7 @@ class PythonScript(threading.Thread):
else
:
else
:
# something unexpected happend here, this script was supposed to survive at leat the timeout
# something unexpected happend here, this script was supposed to survive at leat the timeout
if
len
(
self
.
err
)
is
not
0
:
if
len
(
self
.
err
)
is
not
0
:
stderr
=
"
\n
"
.
join
([
" "
*
10
+
v
for
v
in
self
.
err
.
decode
(
"utf-8"
)
.
split
(
"
\n
"
)])
stderr
=
"
\n
"
*
5
+
self
.
err
raise
AssertionError
(
stderr
)
raise
AssertionError
(
stderr
)
...
...
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