-
Notifications
You must be signed in to change notification settings - Fork 4.3k
better logging for ports and versions #3048
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
Conversation
chriselion
commented
Dec 7, 2019
- Clean up (IMHO) the port decision logic on C# side
- Always print the version information on python
- Print the port number when waiting for editor connection
- If editor doesn't connect, print the port and API version.
One thing I didn't realize earlier is that we lost some of the exception information coming from here ml-agents/UnitySDK/Assets/ML-Agents/Scripts/Grpc/RpcCommunicator.cs Lines 92 to 103 in 22520fe
because this is the expected path when doing inference. Not the end of the world though. |
@@ -217,6 +225,10 @@ void InitializeEnvironment() | |||
} | |||
catch | |||
{ | |||
Debug.Log($"" + | |||
$"Couldn't connect to trainer on port {port} using API version {k_ApiVersion}. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope this is OK, I want some information to make sure we're using the same port as python, but also want to make it clear that this is expected sometimes (when doing inference).
{ | ||
Communicator = new RpcCommunicator( | ||
new CommunicatorInitParameters | ||
{ | ||
port = ReadArgs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The try/catch here was really for the ReadArgs(); RpcCommunicator never throws.
TensorFlow: {tf_utils.tf.__version__} | ||
""" | ||
return f""" Version information: | ||
ml-agents: {mlagents.trainers.__version__}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just trimmed up the whitespace here.
@@ -170,7 +169,7 @@ def parse_command_line(argv: Optional[List[str]] = None) -> CommandLineOptions: | |||
"--cpu", default=False, action="store_true", help="Run with CPU only" | |||
) | |||
|
|||
parser.add_argument("--version", action="version", version=get_version_string()) | |||
parser.add_argument("--version", action="version", version="") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--version
still works, but we always print the version anyway. I think it's worth keeping since that's a standard argument for a CLI.