Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_strategy_cvr
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
rank
gm_strategy_cvr
Commits
feb917d7
Commit
feb917d7
authored
Jul 23, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update condig
parent
adf8816b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
main.py
src/main.py
+8
-3
No files found.
src/main.py
View file @
feb917d7
...
@@ -21,9 +21,9 @@ from models.esmm.model import esmm_model_fn, model_export, model_predict_diary
...
@@ -21,9 +21,9 @@ from models.esmm.model import esmm_model_fn, model_export, model_predict_diary
def
main
():
def
main
():
time_begin
=
time
.
time
()
time_begin
=
time
.
time
()
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
tf
.
logging
.
set_verbosity
(
tf
.
compat
.
v1
.
logging
.
INFO
)
os
.
environ
[
"CUDA_VISIBLE_DEVICES"
]
=
"-1"
#
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
device_df
,
diary_df
,
click_df
,
conversion_df
=
read_csv_data
(
Path
(
"~/data/cvr_data/"
))
device_df
,
diary_df
,
click_df
,
conversion_df
=
read_csv_data
(
Path
(
"~/data/cvr_data/"
))
# print(diary_df.sample(1))
# print(diary_df.sample(1))
...
@@ -43,7 +43,12 @@ def main():
...
@@ -43,7 +43,12 @@ def main():
# if os.path.exists(model_path):
# if os.path.exists(model_path):
# shutil.rmtree(model_path)
# shutil.rmtree(model_path)
model
=
tf
.
estimator
.
Estimator
(
model_fn
=
esmm_model_fn
,
params
=
params
,
model_dir
=
model_path
)
session_config
=
tf
.
ConfigProto
()
session_config
.
gpu_options
.
allow_growth
=
True
session_config
.
gpu_options
.
per_process_gpu_memory_fraction
=
0.9
estimator_config
=
tf
.
estimator
.
RunConfig
(
session_config
=
session_config
)
model
=
tf
.
estimator
.
Estimator
(
model_fn
=
esmm_model_fn
,
params
=
params
,
model_dir
=
model_path
,
config
=
estimator_config
)
train_spec
=
tf
.
estimator
.
TrainSpec
(
input_fn
=
lambda
:
esmm_input_fn
(
train_df
,
shuffle
=
True
),
max_steps
=
50000
)
train_spec
=
tf
.
estimator
.
TrainSpec
(
input_fn
=
lambda
:
esmm_input_fn
(
train_df
,
shuffle
=
True
),
max_steps
=
50000
)
eval_spec
=
tf
.
estimator
.
EvalSpec
(
input_fn
=
lambda
:
esmm_input_fn
(
val_df
,
shuffle
=
False
))
eval_spec
=
tf
.
estimator
.
EvalSpec
(
input_fn
=
lambda
:
esmm_input_fn
(
val_df
,
shuffle
=
False
))
tf
.
estimator
.
train_and_evaluate
(
model
,
train_spec
,
eval_spec
)
tf
.
estimator
.
train_and_evaluate
(
model
,
train_spec
,
eval_spec
)
...
...
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