Skip to content

Commit 3902463

Browse files
Ervin TJonathan Harper
authored andcommitted
Fix not saving .nn file after max_timesteps (#1896)
Sends close command when closing workers.
1 parent a2aa7a2 commit 3902463

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ml-agents-envs/mlagents/envs/subprocess_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def recv(self) -> EnvironmentResponse:
3434
return response
3535

3636
def close(self):
37+
self.conn.send(EnvironmentCommand("close"))
3738
self.process.join()
3839

3940

@@ -61,7 +62,6 @@ def _send_response(cmd_name, payload):
6162
elif cmd.name == 'global_done':
6263
_send_response('global_done', env.global_done)
6364
elif cmd.name == 'close':
64-
env.close()
6565
break
6666
except KeyboardInterrupt:
6767
print('UnityEnvironment worker: keyboard interrupt')

0 commit comments

Comments
 (0)