Add Save model weights immediately future
add save button@Unity then send "saveNow" Toggle to Python. delete useless method "saveModel" and "loadModel". Use Save/load weights instead.
This commit is contained in:
@@ -1 +1 @@
|
||||
{"count":1,"self":16.1291616,"total":16.1316623,"children":{"InitializeActuators":{"count":2,"self":0.0010018,"total":0.0010018,"children":null},"InitializeSensors":{"count":2,"self":0.001,"total":0.001,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1662370082","unity_version":"2020.3.19f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2020.3.19f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-PPO-MultiScene -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 209fdf30-2c1f-11ed-916f-33e85f4223cc -accessToken 3CjC0epfWRwxG_KrVpNvr61CG1zT0gOQYZxf1vrmOrM00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.0","scene_name":"InGame","end_time_seconds":"1662370098"}}
|
||||
{"count":1,"self":49.843855999999995,"total":49.849858,"children":{"InitializeActuators":{"count":2,"self":0.0010003,"total":0.0010003,"children":null},"InitializeSensors":{"count":2,"self":0.0010000999999999999,"total":0.0010000999999999999,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1662380026","unity_version":"2020.3.19f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2020.3.19f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-PPO\\Aimbot-PPO-MultiScene -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 209fdf30-2c1f-11ed-916f-33e85f4223cc -accessToken IuORxC7h70N41GHOqk3KOoetERc0UUQjx5TXQ7GcoN400ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.0","scene_name":"InGame","end_time_seconds":"1662380076"}}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -499,6 +499,8 @@ public class AgentWithGun : Agent
|
||||
//sensor.AddObservation(raySensorNum); // raySensor数量 int
|
||||
sensor.AddObservation(LoadDirDateF); // 用于loadModel的第一级dir
|
||||
sensor.AddObservation(loadDirTimeF); // 用于loadModel的第二级dir
|
||||
sensor.AddObservation(saveNow); // sent saveNow Toggle to python let agent save weights
|
||||
saveNow = 0; // reset saveNow Toggle
|
||||
//sensor.AddObservation(remainTime); // RemainTime int
|
||||
}
|
||||
|
||||
|
||||
@@ -7,5 +7,7 @@ public class SaveWeightsButton : MonoBehaviour
|
||||
public GameObject Agent;
|
||||
public void onButtonClicked()
|
||||
{
|
||||
// set saveNow to active.
|
||||
Agent.GetComponent<AgentWithGun>().saveNow = 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user