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
4f3d4e27
Commit
4f3d4e27
authored
Nov 08, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc fixes..
parent
1188b56d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
examples/HED/README.md
examples/HED/README.md
+1
-2
examples/ResNet/imagenet-resnet.py
examples/ResNet/imagenet-resnet.py
+2
-2
tensorpack/callbacks/param.py
tensorpack/callbacks/param.py
+5
-4
tensorpack/dataflow/dftools.py
tensorpack/dataflow/dftools.py
+3
-3
tensorpack/predict/dataset.py
tensorpack/predict/dataset.py
+1
-1
tensorpack/tfutils/sessinit.py
tensorpack/tfutils/sessinit.py
+1
-1
No files found.
examples/HED/README.md
View file @
4f3d4e27
...
...
@@ -38,7 +38,6 @@ Models I trained can be downloaded [here](https://drive.google.com/drive/folders
To view the loss curve:
```
bash
cat
train_log/hed/stat.json | jq
'.[] |
[.xentropy1,.xentropy2,.xentropy3,.xentropy4,.xentropy5,.xentropy6] |
map(tostring) | join("\t") | .'
-r
|
\
"\(.xentropy1)\t\(.xentropy2)\t\(.xentropy3)\t\(.xentropy4)\t\(.xentropy5)\t\(.xentropy6)"'
-r
|
\
../../scripts/plot-point.py
--legend
1,2,3,4,5,final
--decay
0.8
```
examples/ResNet/imagenet-resnet.py
View file @
4f3d4e27
...
...
@@ -18,8 +18,8 @@ from tensorpack.tfutils.symbolic_functions import *
from
tensorpack.tfutils.summary
import
*
"""
Training code of Pre-Activation version of ResNet on ImageNet.
Work In Progress.
Top1 error is now about 0.5
%
higher than fb.resnet.torch.
Training code of Pre-Activation version of ResNet on ImageNet.
Mainly follow the setup in fb.resnet.torch
"""
...
...
tensorpack/callbacks/param.py
View file @
4f3d4e27
...
...
@@ -207,8 +207,9 @@ class StatMonitorParamSetter(HyperParamSetter):
):
"""
Change param by `new_value = value_func(old_value)`,
if `stat_name` wasn't decreasing > threshold times in the lastest
last_k times of statistics update.
if :
min(stats) >= stats[0] - threshold, where
stats = [`stat_nam` in latest `last_k` epochs]
For example, if error wasn't decreasing, anneal the learning rate:
StatMonitorParamSetter('learning_rate', 'val-error', lambda x: x * 0.2)
...
...
@@ -235,11 +236,11 @@ class StatMonitorParamSetter(HyperParamSetter):
hist_first
=
hist
[
0
]
if
not
self
.
reverse
:
hist_min
=
min
(
hist
)
if
hist_min
<
=
hist_first
-
self
.
threshold
:
# small enough
if
hist_min
<
hist_first
-
self
.
threshold
:
# small enough
return
None
else
:
hist_max
=
max
(
hist
)
if
hist_max
>
=
hist_first
+
self
.
threshold
:
# large enough
if
hist_max
>
hist_first
+
self
.
threshold
:
# large enough
return
None
self
.
last_changed_epoch
=
self
.
epoch_num
return
self
.
value_func
(
self
.
get_current_value
())
...
...
tensorpack/dataflow/dftools.py
View file @
4f3d4e27
...
...
@@ -4,7 +4,7 @@
import
sys
,
os
import
cv2
import
multiprocessing
import
multiprocessing
as
mp
from
..utils.concurrency
import
DIE
from
..utils.fs
import
mkdir_p
...
...
@@ -44,8 +44,8 @@ def dataflow_to_process_queue(ds, size, nr_consumer):
:returns: (queue, process). The process will take data from `ds` to fill
the queue once you start it. Each element is (task_id, dp).
"""
q
=
m
ultiprocessing
.
Queue
(
size
)
class
EnqueProc
(
m
ultiprocessing
.
Process
):
q
=
m
p
.
Queue
(
size
)
class
EnqueProc
(
m
p
.
Process
):
def
__init__
(
self
,
ds
,
q
,
nr_consumer
):
super
(
EnqueProc
,
self
)
.
__init__
()
self
.
ds
=
ds
...
...
tensorpack/predict/dataset.py
View file @
4f3d4e27
...
...
@@ -101,7 +101,7 @@ class MultiProcessDatasetPredictor(DatasetPredictorBase):
# setup all the procs
self
.
inqueue_proc
.
start
()
for
p
,
gpuid
in
zip
(
self
.
workers
,
gpus
):
if
gpuid
==
''
:
if
gpuid
==
'
-1
'
:
logger
.
info
(
"Worker {} uses CPU"
.
format
(
p
.
idx
))
else
:
logger
.
info
(
"Worker {} uses GPU {}"
.
format
(
p
.
idx
,
gpuid
))
...
...
tensorpack/tfutils/sessinit.py
View file @
4f3d4e27
...
...
@@ -62,7 +62,7 @@ class SaverRestore(SessionInit):
if
os
.
path
.
basename
(
model_path
)
==
'checkpoint'
:
model_path
=
tf
.
train
.
latest_checkpoint
(
os
.
path
.
dirname
(
model_path
))
# to be consistent with either v1 or v2
assert
os
.
path
.
isfile
(
model_path
)
or
os
.
path
.
isfile
(
model_path
+
'.index'
)
assert
os
.
path
.
isfile
(
model_path
)
or
os
.
path
.
isfile
(
model_path
+
'.index'
)
,
model_path
self
.
set_path
(
model_path
)
self
.
prefix
=
prefix
...
...
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