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
d8e2929b
Commit
d8e2929b
authored
Jul 03, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small clean-ups
parent
bf6402ad
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
7 deletions
+6
-7
examples/CaffeModels/load-alexnet.py
examples/CaffeModels/load-alexnet.py
+0
-1
examples/FasterRCNN/eval.py
examples/FasterRCNN/eval.py
+2
-1
examples/GAN/Improved-WGAN.py
examples/GAN/Improved-WGAN.py
+1
-1
examples/GAN/README.md
examples/GAN/README.md
+1
-1
examples/OpticalFlow/flownet2.py
examples/OpticalFlow/flownet2.py
+2
-2
examples/Saliency/CAM-resnet.py
examples/Saliency/CAM-resnet.py
+0
-1
No files found.
examples/CaffeModels/load-alexnet.py
View file @
d8e2929b
...
@@ -13,7 +13,6 @@ import tensorflow as tf
...
@@ -13,7 +13,6 @@ import tensorflow as tf
from
tensorpack
import
*
from
tensorpack
import
*
from
tensorpack.dataflow.dataset
import
ILSVRCMeta
from
tensorpack.dataflow.dataset
import
ILSVRCMeta
from
tensorpack.tfutils.summary
import
*
from
tensorpack.tfutils.summary
import
*
from
tensorpack.tfutils.symbolic_functions
import
*
def
tower_func
(
image
):
def
tower_func
(
image
):
...
...
examples/FasterRCNN/eval.py
View file @
d8e2929b
...
@@ -234,7 +234,8 @@ class EvalCallback(Callback):
...
@@ -234,7 +234,8 @@ class EvalCallback(Callback):
shard
=
k
,
num_shards
=
self
.
num_predictor
)
shard
=
k
,
num_shards
=
self
.
num_predictor
)
for
k
in
range
(
self
.
num_predictor
)]
for
k
in
range
(
self
.
num_predictor
)]
else
:
else
:
# Only eval on the first machine.
# Only eval on the first machine,
# Because evaluation assumes that all horovod workers share the filesystem.
# Alternatively, can eval on all ranks and use allgather, but allgather sometimes hangs
# Alternatively, can eval on all ranks and use allgather, but allgather sometimes hangs
self
.
_horovod_run_eval
=
hvd
.
rank
()
==
hvd
.
local_rank
()
self
.
_horovod_run_eval
=
hvd
.
rank
()
==
hvd
.
local_rank
()
if
self
.
_horovod_run_eval
:
if
self
.
_horovod_run_eval
:
...
...
examples/GAN/Improved-WGAN.py
View file @
d8e2929b
...
@@ -70,7 +70,7 @@ class Model(DCGAN.Model):
...
@@ -70,7 +70,7 @@ class Model(DCGAN.Model):
# the gradient penalty loss
# the gradient penalty loss
gradients
=
tf
.
gradients
(
vec_interp
,
[
interp
])[
0
]
gradients
=
tf
.
gradients
(
vec_interp
,
[
interp
])[
0
]
gradients
=
tf
.
sqrt
(
tf
.
reduce_sum
(
tf
.
square
(
gradients
),
[
1
,
2
,
3
]))
gradients
=
tf
.
sqrt
(
tf
.
reduce_sum
(
tf
.
square
(
gradients
),
[
1
,
2
,
3
]))
gradients_rms
=
symbolic_functions
.
rms
(
gradients
,
'gradient_rms'
)
gradients_rms
=
tf
.
sqrt
(
tf
.
reduce_mean
(
tf
.
square
(
gradients
)),
name
=
'gradient_rms'
)
gradient_penalty
=
tf
.
reduce_mean
(
tf
.
square
(
gradients
-
1
),
name
=
'gradient_penalty'
)
gradient_penalty
=
tf
.
reduce_mean
(
tf
.
square
(
gradients
-
1
),
name
=
'gradient_penalty'
)
add_moving_summary
(
self
.
d_loss
,
self
.
g_loss
,
gradient_penalty
,
gradients_rms
)
add_moving_summary
(
self
.
d_loss
,
self
.
g_loss
,
gradient_penalty
,
gradients_rms
)
...
...
examples/GAN/README.md
View file @
d8e2929b
# Generative Adversarial Networks
# Generative Adversarial Networks
Reproduce the following GAN-related methods,
100~200 lines each
:
Reproduce the following GAN-related methods,
__100~200 lines each__
:
+
DCGAN (
[
Unsupervised Representation Learning with DCGAN
](
https://arxiv.org/abs/1511.06434
)
)
+
DCGAN (
[
Unsupervised Representation Learning with DCGAN
](
https://arxiv.org/abs/1511.06434
)
)
...
...
examples/OpticalFlow/flownet2.py
View file @
d8e2929b
...
@@ -28,7 +28,7 @@ def apply(model, model_path, images, ground_truth=None):
...
@@ -28,7 +28,7 @@ def apply(model, model_path, images, ground_truth=None):
input_names
=
[
'left'
,
'right'
],
input_names
=
[
'left'
,
'right'
],
output_names
=
[
'prediction'
]))
output_names
=
[
'prediction'
]))
for
right
in
images
[
1
:]
:
for
idx
,
right
in
enumerate
(
images
[
1
:])
:
right
=
aug
.
augment
(
cv2
.
imread
(
right
))
right
=
aug
.
augment
(
cv2
.
imread
(
right
))
left_input
,
right_input
=
[
x
.
astype
(
'float32'
)
.
transpose
(
2
,
0
,
1
)[
None
,
...
]
left_input
,
right_input
=
[
x
.
astype
(
'float32'
)
.
transpose
(
2
,
0
,
1
)[
None
,
...
]
...
@@ -43,7 +43,7 @@ def apply(model, model_path, images, ground_truth=None):
...
@@ -43,7 +43,7 @@ def apply(model, model_path, images, ground_truth=None):
img
=
viz
.
stack_patches
(
patches
,
2
,
2
)
img
=
viz
.
stack_patches
(
patches
,
2
,
2
)
cv2
.
imshow
(
'flow output'
,
img
)
cv2
.
imshow
(
'flow output'
,
img
)
cv2
.
imwrite
(
'flow_
prediction.png'
,
img
)
cv2
.
imwrite
(
'flow_
output{:03d}.png'
.
format
(
idx
)
,
img
)
cv2
.
waitKey
(
0
)
cv2
.
waitKey
(
0
)
left
=
right
left
=
right
...
...
examples/Saliency/CAM-resnet.py
View file @
d8e2929b
...
@@ -14,7 +14,6 @@ from tensorpack import *
...
@@ -14,7 +14,6 @@ from tensorpack import *
from
tensorpack.dataflow
import
dataset
from
tensorpack.dataflow
import
dataset
from
tensorpack.tfutils
import
gradproc
,
optimizer
from
tensorpack.tfutils
import
gradproc
,
optimizer
from
tensorpack.tfutils.summary
import
*
from
tensorpack.tfutils.summary
import
*
from
tensorpack.tfutils.symbolic_functions
import
*
from
tensorpack.utils
import
viz
from
tensorpack.utils
import
viz
from
tensorpack.utils.gpu
import
get_num_gpu
from
tensorpack.utils.gpu
import
get_num_gpu
...
...
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