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
4fa2837e
You need to sign in or sign up before continuing.
Commit
4fa2837e
authored
Feb 06, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add graph.finalize
parent
dcf55733
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
tensorpack/train.py
tensorpack/train.py
+3
-1
tensorpack/utils/concurrency.py
tensorpack/utils/concurrency.py
+2
-1
No files found.
tensorpack/train.py
View file @
4fa2837e
...
@@ -171,6 +171,8 @@ def start_train(config):
...
@@ -171,6 +171,8 @@ def start_train(config):
try
:
try
:
logger
.
info
(
"Start training with global_step={}"
.
format
(
get_global_step
()))
logger
.
info
(
"Start training with global_step={}"
.
format
(
get_global_step
()))
callbacks
.
before_train
()
callbacks
.
before_train
()
tf
.
get_default_graph
()
.
finalize
()
for
epoch
in
xrange
(
1
,
config
.
max_epoch
):
for
epoch
in
xrange
(
1
,
config
.
max_epoch
):
with
timed_operation
(
'epoch {}'
.
format
(
epoch
)):
with
timed_operation
(
'epoch {}'
.
format
(
epoch
)):
for
step
in
tqdm
.
trange
(
for
step
in
tqdm
.
trange
(
...
@@ -186,7 +188,7 @@ def start_train(config):
...
@@ -186,7 +188,7 @@ def start_train(config):
raise
raise
finally
:
finally
:
coord
.
request_stop
()
coord
.
request_stop
()
input_queue
.
close
(
cancel_pending_enqueues
=
True
)
# Do I need to run queue.close
callbacks
.
after_train
()
callbacks
.
after_train
()
sess
.
close
()
sess
.
close
()
tensorpack/utils/concurrency.py
View file @
4fa2837e
...
@@ -33,6 +33,7 @@ class EnqueueThread(threading.Thread):
...
@@ -33,6 +33,7 @@ class EnqueueThread(threading.Thread):
self
.
dataflow
=
dataflow
self
.
dataflow
=
dataflow
self
.
op
=
enqueue_op
self
.
op
=
enqueue_op
self
.
queue
=
queue
self
.
queue
=
queue
self
.
close_op
=
self
.
queue
.
close
(
cancel_pending_enqueues
=
True
)
self
.
daemon
=
True
self
.
daemon
=
True
...
@@ -49,5 +50,5 @@ class EnqueueThread(threading.Thread):
...
@@ -49,5 +50,5 @@ class EnqueueThread(threading.Thread):
pass
pass
except
Exception
:
except
Exception
:
logger
.
exception
(
"Exception in EnqueueThread:"
)
logger
.
exception
(
"Exception in EnqueueThread:"
)
self
.
queue
.
close
(
cancel_pending_enqueues
=
True
)
self
.
sess
.
run
(
self
.
close_op
)
self
.
coord
.
request_stop
()
self
.
coord
.
request_stop
()
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