Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved MLAgents - unexpected exception when trying to initialize communication

Discussion in 'ML-Agents' started by carlv, May 19, 2021.

  1. carlv

    carlv

    Joined:
    May 19, 2021
    Posts:
    3
    Hi, I've just started using MLAgents on unity for the first time but, for some reason, when I try to perform the steps I'm following from a "Hello Word", using the command "mlagents-learn" on the cmd and by pressing play on the Unity Editor, I get the following errors:

    upload_2021-5-19_19-12-15.png

    And on the cmd, after not being able to connect with the Unity Editor, I get the following exception:
    upload_2021-5-19_19-13-24.png


    I've chande versions multiple times and I made sure that all the versions are compatible.
    Currently I'm using:

    OS: Windows 10
    Python Version: 3.7.9
    Python mlagents: 0.25.1
    Unity ML Agents package: 1.9.1 - preview

    Basically, I'm not able to get Unity Editor to connect with Python.

    Any idea of what might be the problem? I've already searched the errors/excpetion that I got but with no luck... Thanks in advance!
     
  2. ruoping_unity

    ruoping_unity

    Unity Technologies

    Joined:
    Jul 10, 2020
    Posts:
    134
    What's the "Hello Word" you're trying to do?

    Try run a training with any of our example environments. If that doesn't work then something is wrong with your installation setup.

    If that works and you only see error with your scene, I'll need more details about your scene and agent setup, and the steps to reproduce the error in order to help.
     
  3. carlv

    carlv

    Joined:
    May 19, 2021
    Posts:
    3
    Thank you for your response! I've been searching a little more and found out that I had to update the gRPC package my project was using. I downloaded the version 2.39.0 from here https://packages.grpc.io/, I placed the folder inside the "Assets" folder in the project and then I had to delete the Grpc.Core.dll on the ml-agents package from the library and the Google.Protobuff.dll on te barracuda package because they were causing some conflitcts because those .dll files are already on the project from the gRPC update. I tested again and it worked! Thank you once again!
     
    Lion_C and develop_91Act like this.