Skip to content

Commit

Permalink
better message for new model format (#5240)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Elion authored Apr 10, 2021
1 parent f8f2bfe commit 88f886b
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,22 @@ public static IEnumerable<string> CheckModel(Model model, BrainParameters brainP
"Cannot use this model.");
return failedModelChecks;
}
if (modelApiVersion != k_ApiVersion)
if (modelApiVersion < k_ApiVersion)
{
failedModelChecks.Add(
$"Version of the trainer the model was trained with ({modelApiVersion}) " +
$"is not compatible with the Brain's version ({k_ApiVersion}).");
return failedModelChecks;
}
if (modelApiVersion > k_ApiVersion)
{
failedModelChecks.Add(
"Model was trained with a newer version of the trainer than is supported. " +
"Either retrain with an older trainer, or update to a newer version of com.unity.ml-agents.\n" +
$"Model version: {modelApiVersion} Supported version: {k_ApiVersion}"
);
return failedModelChecks;
}

var memorySize = (int)model.GetTensorByName(TensorNames.MemorySize)[0];
if (memorySize == -1)
Expand Down

0 comments on commit 88f886b

Please sign in to comment.