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
bb058a43
Commit
bb058a43
authored
Apr 12, 2019
by
IlyaOvodov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upd params.save (create dirs), log (log.log)
parent
52cc9096
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
ignite_tools.py
ovotools/ignite_tools.py
+1
-1
params.py
ovotools/params.py
+4
-1
No files found.
ovotools/ignite_tools.py
View file @
bb058a43
...
...
@@ -125,7 +125,7 @@ class LogTrainingResults:
self
.
best_model_buffer
=
best_model_buffer
self
.
params
=
params
if
filename
is
None
:
filename
=
self
.
params
.
get_model_name
()
+
"
.log"
filename
=
"log
.log"
self
.
file_name
=
os
.
path
.
join
(
self
.
params
.
get_base_filename
(),
rel_dir
,
filename
)
self
.
calls_count
=
collections
.
defaultdict
(
int
)
...
...
ovotools/params.py
View file @
bb058a43
...
...
@@ -71,7 +71,7 @@ class AttrDict(dict):
assert
self
.
has
(
'data_root'
)
return
os
.
path
.
join
(
self
.
data_root
,
self
.
get_model_name
())
def
save
(
self
,
base_fn
=
None
,
verbose
=
1
,
can_overwrite
=
False
):
def
save
(
self
,
base_fn
=
None
,
verbose
=
1
,
can_overwrite
=
False
,
create_dirs
=
False
):
'''
save to file adding '.param.txt' to name
'''
...
...
@@ -80,6 +80,9 @@ class AttrDict(dict):
params_fn
=
base_fn
+
'.param.txt'
if
not
can_overwrite
:
assert
not
os
.
path
.
exists
(
params_fn
),
"Can't save parameters to {}: File exists"
.
format
(
params_fn
)
if
create_dirs
:
dir_name
=
os
.
path
.
dirname
(
params_fn
)
os
.
makedirs
(
dir_name
,
exist_ok
=
True
)
with
open
(
params_fn
,
'w+'
)
as
f
:
s
=
repr
(
self
)
s
=
s
+
'
\n
hash: '
+
self
.
hash
()
...
...
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