Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OvoTools
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林帅浩
OvoTools
Commits
52cc9096
Commit
52cc9096
authored
Apr 09, 2019
by
Ilya Ovodov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tb logger start_server
parent
1237f3d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
ignite_tools.py
ovotools/ignite_tools.py
+8
-3
No files found.
ovotools/ignite_tools.py
View file @
52cc9096
import
copy
import
copy
import
math
import
math
import
os
import
os
import
subprocess
import
torch
import
torch
import
ignite
import
ignite
from
ignite.engine
import
Events
from
ignite.engine
import
Events
...
@@ -172,9 +173,13 @@ class TensorBoardLogger:
...
@@ -172,9 +173,13 @@ class TensorBoardLogger:
trainer_engine
.
add_event_handler
(
Events
.
COMPLETED
,
self
.
on_completed
)
trainer_engine
.
add_event_handler
(
Events
.
COMPLETED
,
self
.
on_completed
)
def
start_server
(
self
,
port
):
def
start_server
(
self
,
port
):
cmd
=
r"tensorboard --host 127.0.0.1 --port {port} --logdir {dir}"
.
format
(
port
=
port
,
dir
=
self
.
log_dir
)
#cmd = r"tensorboard --host 127.0.0.1 --port {port} --logdir {dir}".format(port=port, dir=self.log_dir)
print
(
cmd
)
#print(cmd)
os
.
popen
(
cmd
)
#os.popen(cmd)
cmd
=
r'tensorboard --host 127.0.0.1 --port {port} --logdir ""'
.
format
(
port
=
port
)
.
split
(
' '
)
cmd
[
-
1
]
=
self
.
log_dir
# can contain spaces
print
(
' '
.
join
(
cmd
))
subprocess
.
Popen
(
cmd
)
def
on_completed
(
self
,
engine
):
def
on_completed
(
self
,
engine
):
self
.
writer
.
close
()
self
.
writer
.
close
()
...
...
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