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:
2022-09-05 21:22:34 +09:00
parent 2d404cfdf2
commit 763d704efd
7 changed files with 202 additions and 527 deletions
@@ -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;
}
}