浏览代码

[verified branch] better message for new model format (#5245)

/release_2_verified
GitHub 3 年前
当前提交
741d75d5
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. 2
      .pre-commit-config.yaml
  2. 12
      com.unity.ml-agents/Runtime/Inference/BarracudaModelParamLoader.cs

2
.pre-commit-config.yaml


args: [--assume-in-merge]
- id: check-yaml
# Won't handle the templating in yamato
exclude: \.yamato/*
exclude: \.yamato/.*
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.4.2

12
com.unity.ml-agents/Runtime/Inference/BarracudaModelParamLoader.cs


"Cannot use this model.");
return failedModelChecks;
}
if (modelApiVersion != k_ApiVersion)
if (modelApiVersion < 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;
}

正在加载...
取消
保存