Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygo-agent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Biluo Shen
ygo-agent
Commits
878f6a9e
Commit
878f6a9e
authored
Jul 18, 2024
by
sbl1996@126.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ckpt
parent
b3160234
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
scripts/cleanba.py
scripts/cleanba.py
+0
-3
ygoai/rl/ckpt.py
ygoai/rl/ckpt.py
+7
-5
No files found.
scripts/cleanba.py
View file @
878f6a9e
...
...
@@ -1189,9 +1189,6 @@ def main():
if
args
.
local_rank
==
0
and
learner_policy_version
%
args
.
save_interval
==
0
and
not
args
.
debug
:
ckpt_steps
=
tb_global_step
//
2
**
20
step_str
=
"M"
if
ckpt_steps
==
0
:
ckpt_steps
=
tb_global_step
//
2
**
10
step_str
=
"K"
ckpt_name
=
f
"{timestamp}_{ckpt_steps}{step_str}.flax_model"
ckpt_maneger
.
save
(
unreplicated_params
,
ckpt_name
)
...
...
ygoai/rl/ckpt.py
View file @
878f6a9e
...
...
@@ -40,11 +40,13 @@ class ModelCheckpoint(object):
print
(
f
"Saved model to {path}"
)
if
len
(
self
.
_saved
)
>
self
.
_n_saved
:
path
=
self
.
_saved
.
pop
(
0
)
if
path
.
is_dir
():
shutil
.
rmtree
(
path
)
else
:
os
.
remove
(
path
)
to_remove
=
self
.
_saved
.
pop
(
0
)
if
to_remove
!=
path
:
if
to_remove
.
is_dir
():
shutil
.
rmtree
(
to_remove
)
else
:
if
to_remove
.
exists
():
os
.
remove
(
to_remove
)
def
get_latest
(
self
):
path
=
self
.
_saved
[
-
1
]
...
...
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