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:
@@ -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