Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Help with sidechannel

Discussion in 'ML-Agents' started by botmation, Aug 27, 2020.

  1. botmation

    botmation

    Joined:
    Aug 27, 2020
    Posts:
    2
    I tried following the instructions at the site below. When I click the play button I get the following in console.
    Assets/ML-Agents/StringLogSideChannel.cs(14,26): error CS0507: 'StringLogSideChannel.OnMessageReceived(IncomingMessage)': cannot change access modifiers when overriding 'protected' inherited member 'SideChannel.OnMessageReceived(IncomingMessage)'


    https://github.com/Unity-Technologi...ase_3_distributed/docs/Custom-SideChannels.md

    I am using ML agent 1.02 and unity 2019.4.

    Is the documentation correct or am I missing something?
     
  2. ReinierJ

    ReinierJ

    Joined:
    Jul 10, 2020
    Posts:
    10
    In the SideChannel class, the OnMessageReceived method is protected, not public.

    Try
    Code (CSharp):
    1. protected override void OnMessageReceived
    instead of
    Code (CSharp):
    1. public override void OnMessageReceived
    If that works, then most likely the documentation is incorrect.
     
  3. botmation

    botmation

    Joined:
    Aug 27, 2020
    Posts:
    2
    Yes that worked. Thank you.

    Also for anyone else who gets stumped by this. I had to fix other items too after this. I also had to add
    Code (CSharp):
    1. using Unity.MLAgents.SideChannels;
    2.  
    3.  
    Then in regisiterlogsidechannel
    SideChannelManager.RegisterSideChannel(stringChannel);

    Changed to

    SideChannelsManager.RegisterSideChannel(stringChannel);


    In the python code a lot of the unity env calls are no longer valid.
    See https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Python-API.md
     
  4. ReinierJ

    ReinierJ

    Joined:
    Jul 10, 2020
    Posts:
    10