Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom network #6

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion training/scripts/train_agent.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def main():
verbose=1,
)
elif args.agent is not None:
agent: Union[Type[BaseAgent], Type[ActorCriticPolicy]] = AgentFactory.instantiate(args.agent)
agent: Union[Type[BaseAgent], Type[ActorCriticPolicy]] = AgentFactory.instantiate(args.agent, path = args.path)
if isinstance(agent, BaseAgent):
model = PPO(
agent.type.value,
Expand Down
6 changes: 6 additions & 0 deletions training/tools/argsparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def training_args(parser):
import rosnav.model.custom_policy
import rosnav.model.custom_sb3_policy
from rosnav.model.agent_factory import AgentFactory
import rosnav.model.custom_policy_from_json

group.add_argument(
"--agent",
Expand Down Expand Up @@ -60,6 +61,11 @@ def training_args(parser):
parser.add_argument(
"--tb", action="store_true", help="enables tensorboard logging"
)
parser.add_argument(
"--path",
type=str,
help="path to the json file containing" "the neural network",
)


def run_agent_args(parser):
Expand Down