Open jingrui-who opened 4 years ago
Hi and welcome! :-) See the last code block in the Quick Start Guide tutorial. It shows an example of checkpoint loading and evaluation.
Does this load the best model or just load the latest model? Some times when i train, the latest evaluation model seems to perform worst then the previous ones.
It loads the model in the latest file stored in the checkpoint directory. Checkpoint file names contain the number of training steps, which can help you choose which model to load if you'd like to evaluate a model other than the latest.
Hi, sorry for the trouble again. I am still unsure of how to load and use a model
Currently, i am using the following code to use the step model to see the decision at each state
env_params = GymVectorEnvironment(level='MachineSimple-v0') env = GymEnvironment(**env_params.dict, visualization_parameters=VisualizationParameters()) response = env.reset_internalstate() for in range(10): action_info = coach.graph_manager.get_agent().choose_action(response.next_state) print("State:{}, Action:{}".format(response.next_state,action_info.action)) response = env.step(action_info.action) print("Reward:{}".format(response.reward))
However, this requires me to train a model and use it immediately. Is there a place to store and load the model? I was expecting something similar like model.fit()/model.load() and model.predict()
The last code block in the Quick Start Guide tutorial seems to only load check point and evaluate it. However, i am need to use the .step() method to output a decision for my use case. is there a way to go about doing this?
For future searchers and @e0003315, take a look at #374. The comment has a good example of doing this.
Hi, i am new to coach. I was following the tutorial for using coach as a library. I was able to reach coach.run() and successfully train the model and view the results in the dashboard.
How do i now load the best model that it has trained to test it out manually? Is there a command like coach.load(model)?