fix: close temporary loaded_env after loading warm-start model to avoid leaving extra TCP vehicle
This commit is contained in:
parent
38dd5e9b1d
commit
0c3a37f877
|
|
@ -180,6 +180,12 @@ if os.path.exists(WARM_PATH):
|
|||
first_throttle_floor = phase_defs[0][1]
|
||||
env0 = VecTransposeImage(DummyVecEnv([make_env_base(0.2, throttle_floor=first_throttle_floor)]))
|
||||
model.set_env(env0)
|
||||
# Close the loaded_env used only for model loading to avoid leaving a stale
|
||||
# TCP connection (which would create an extra vehicle in the simulator).
|
||||
try:
|
||||
loaded_env.close()
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
log('No warm-start found — creating fresh model with base throttle_min=0.2')
|
||||
env0 = VecTransposeImage(DummyVecEnv([make_env_base(0.2, throttle_floor=phase_defs[0][1])]))
|
||||
|
|
|
|||
Loading…
Reference in New Issue