Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RL-Parsing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Franck Dary
RL-Parsing
Commits
9f71f19b
Commit
9f71f19b
authored
3 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Added script to parse train.log
parent
c6826190
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
view.py
+27
-0
27 additions, 0 deletions
view.py
with
27 additions
and
0 deletions
view.py
0 → 100755
+
27
−
0
View file @
9f71f19b
#! /usr/bin/env python3
# EXAMPLE : ./view.py bin/*/*log
import
sys
import
subprocess
cmd
=
'
for f in %s; do echo $f; grep
"
SAVED
"
$f | tail -1; echo
""
; done
'
%
"
"
.
join
(
sys
.
argv
[
1
:
-
1
])
p
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
)
models
=
[]
model
=
[]
for
line
in
p
.
stdout
:
line
=
line
.
decode
(
"
utf-8
"
).
strip
()
if
len
(
line
)
==
0
:
epoch
=
model
[
1
].
split
(
'
,
'
)[
0
].
split
(
'
'
)[
-
1
]
name
=
model
[
0
].
split
(
'
/
'
)[
-
2
]
scores
=
model
[
1
].
split
(
'
:
'
)[
-
1
].
replace
(
'
SAVED
'
,
''
)
score
=
sum
([
float
(
val
.
split
(
'
=
'
)[
-
1
])
for
val
in
scores
.
split
()])
models
.
append
([
score
,
"
%s
\t
%s
\t
%s
"
%
(
epoch
,
scores
,
name
)])
model
=
[]
continue
model
.
append
(
line
)
models
=
sorted
(
models
)[::
-
1
]
print
(
"
\n
"
.
join
([
m
[
1
]
for
m
in
models
]))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment