Open Leterax opened 5 years ago
Hi,
thanks for trying out my project! You are not using one of those environments prebuilt by Udacity as explained in this section, are you?
I suspect the interface might have been simplified and the brain.vector_action_space_size does return an int, not _message.RepeatedScalarContainer. That would explain the first error. So fixing it like that might address this particular problem:
agent = Agent(state_size=state_size, action_size=4, seed=0)
Having said that, if interface with Unity env has changed I suspect you might run into more issues. I assume here that all data exchanged between env and agent (State, Action, Reward etc) are standard numpy arrays, if that is no longer true there will be more errors.
only changed made to the Training.ipynb file are:
from mlagents.envs import UnityEnvironment
, as the location of UnityEnvironment has changed. Training with the built in ml-agents commandline tool works without any problems.when initializing the agent with:
agent = Agent(state_size=state_size, action_size=action_size, seed=0)
whereaction_size
is defined byaction_size = brain.vector_action_space_size
this error is thrown.this is because
action_size
is of the type:<class 'google.protobuf.pyext._message.RepeatedScalarContainer'>
. When initializing the agent with:agent = Agent(state_size=state_size, action_size=action_size[0], seed=0)
no error is thorwn, as now an int is passed. However when training withscores = train_agent(agent, env, output_weights= "new_model_weights.pth", target_mean_score=30, n_episodes=20000)
this error is thrown.UnityActionException: There was a mismatch between the provided action and the environment's expectation: The brain Learning_Brain_02 expected 4 continuous action(s), but was provided: [3.0]