Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
2662b387
Commit
2662b387
authored
5 years ago
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timeline test
parent
be1a3205
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
train.py
eda/esmm/Model_pipline/train.py
+12
-2
No files found.
eda/esmm/Model_pipline/train.py
View file @
2662b387
...
@@ -10,6 +10,7 @@ import os
...
@@ -10,6 +10,7 @@ import os
import
json
import
json
from
datetime
import
date
,
timedelta
from
datetime
import
date
,
timedelta
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow.python.client
import
timeline
import
subprocess
import
subprocess
import
time
import
time
import
glob
import
glob
...
@@ -338,7 +339,9 @@ def main(_):
...
@@ -338,7 +339,9 @@ def main(_):
"ctr_task_wgt"
:
FLAGS
.
ctr_task_wgt
"ctr_task_wgt"
:
FLAGS
.
ctr_task_wgt
}
}
config
=
tf
.
estimator
.
RunConfig
()
.
replace
(
session_config
=
tf
.
ConfigProto
(
device_count
=
{
'GPU'
:
0
,
'CPU'
:
FLAGS
.
num_threads
}),
config
=
tf
.
estimator
.
RunConfig
()
.
replace
(
session_config
=
tf
.
ConfigProto
(
device_count
=
{
'GPU'
:
0
,
'CPU'
:
FLAGS
.
num_threads
}),
log_step_count_steps
=
FLAGS
.
log_steps
,
save_summary_steps
=
FLAGS
.
log_steps
)
log_step_count_steps
=
FLAGS
.
log_steps
,
save_summary_steps
=
FLAGS
.
log_steps
,
graph_options
=
tf
.
GraphOptions
(
optimizer_options
=
tf
.
OptimizerOptions
(
opt_level
=
tf
.
OptimizerOptions
.
L0
)))
Estimator
=
tf
.
estimator
.
Estimator
(
model_fn
=
model_fn
,
model_dir
=
FLAGS
.
model_dir
,
params
=
model_params
,
config
=
config
)
Estimator
=
tf
.
estimator
.
Estimator
(
model_fn
=
model_fn
,
model_dir
=
FLAGS
.
model_dir
,
params
=
model_params
,
config
=
config
)
if
FLAGS
.
task_type
==
'train'
:
if
FLAGS
.
task_type
==
'train'
:
...
@@ -363,7 +366,13 @@ def main(_):
...
@@ -363,7 +366,13 @@ def main(_):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
b
=
time
.
time
()
b
=
time
.
time
()
path
=
"hdfs://172.16.32.4:8020/strategy/esmm/"
path
=
"hdfs://172.16.32.4:8020/strategy/esmm/"
ptions
=
tf
.
RunOptions
(
trace_level
=
tf
.
RunOptions
.
FULL_TRACE
)
run_metadata
=
tf
.
RunMetadata
()
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
tf
.
app
.
run
()
tf
.
app
.
run
(
options
=
ptions
,
run_metadata
=
run_metadata
)
tl
=
timeline
.
Timeline
(
run_metadata
.
step_stats
)
ctf
=
tl
.
generate_chrome_trace_format
()
with
open
(
FLAGS
.
local_dir
+
'timeline.json'
,
'w'
)
as
wd
:
wd
.
write
(
ctf
)
print
(
"耗时(分钟):"
)
print
(
"耗时(分钟):"
)
print
((
time
.
time
()
-
b
)
/
60
)
print
((
time
.
time
()
-
b
)
/
60
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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