File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -335,9 +335,11 @@ def step(self):
335
335
336
336
if self ._snapshotter is not None :
337
337
if self ._snapshotter .save ():
338
- # Log at what actor_steps this snapshot was saved.
339
- if 'actor_steps' in fetches :
340
- fetches ['saved_snapshot_at_actor_steps' ] = fetches ['actor_steps' ]
338
+ # Log at what actor_steps this snapshot was saved. The actor_steps
339
+ # counter is updated at end of episode so fetches['actor_steps']
340
+ # may not exist yet when the first policy snapshot is saved.
341
+ actor_steps = fetches ['actor_steps' ] if 'actor_steps' in fetches else 0
342
+ fetches ['saved_snapshot_at_actor_steps' ] = actor_steps
341
343
# Increment the snapshot counter (directly in the snapshotter's path).
342
344
for path in list (self ._snapshotter ._snapshots .keys ()):
343
345
snapshot = self ._snapshotter ._snapshots [path ] # noqa: F841
You can’t perform that action at this time.
0 commit comments