浏览代码

surface specific GRPC errors more visibly (#4930)

/bullet-hell-barracuda-test-1.3.1
GitHub 3 年前
当前提交
dbf50ca2
共有 2 个文件被更改,包括 29 次插入1 次删除
  1. 2
      com.unity.ml-agents/CHANGELOG.md
  2. 28
      com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs

2
com.unity.ml-agents/CHANGELOG.md


reduced the amount of memory allocated by approximately 25%. (#4887)
- Removed several memory allocations that happened during inference with discrete actions. (#4922)
- Properly catch permission errors when writing timer files. (#4921)
- Unexpected gRPC exceptions during training are now logged before stopping training. If you see
"noisy" log, please let us know! (#4930)
#### ml-agents / ml-agents-envs / gym-unity (Python)
- Fixed a bug that would cause an exception when `RunOptions` was deserialized via `pickle`. (#4842)

28
com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs


{
return null;
}
try
{
var message = m_Client.Exchange(WrapMessage(unityOutput, 200));

QuitCommandReceived?.Invoke();
return message.UnityInput;
}
catch
catch (RpcException rpcException)
// Log more verbose errors if they're something the user can possibly do something about.
switch (rpcException.Status.StatusCode)
{
case StatusCode.Unavailable:
// This can happen when python disconnects. Ignore it to avoid noisy logs.
break;
case StatusCode.ResourceExhausted:
// This happens is the message body is too large. There's no way to
// gracefully handle this, but at least we can show the message and the
// user can try to reduce the number of agents or observation sizes.
Debug.LogError($"GRPC Exception: {rpcException.Message}. Disconnecting from trainer.");
break;
default:
// Other unknown errors. Log at INFO level.
Debug.Log($"GRPC Exception: {rpcException.Message}. Disconnecting from trainer.");
break;
}
m_IsOpen = false;
QuitCommandReceived?.Invoke();
return null;
}
catch (Exception ex)
{
// Fall-through for other error types
Debug.LogError($"GRPC Exception: {ex.Message}. Disconnecting from trainer.");
m_IsOpen = false;
QuitCommandReceived?.Invoke();
return null;

正在加载...
取消
保存