Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
17.12k stars 4.15k forks source link

sidechannels at windows standalone build of Example 3DBall are not working #3610

Closed jdP19 closed 2 years ago

jdP19 commented 4 years ago

The sidechannels to communicate with the standalone build of the Example 3DBall are not working. After following the tutorial on costume sidechannel [(https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Custom-SideChannels.md)] and applying it to the 3DBall example, the following Error appear in the standalone build:

Logtext_3DBall

The unity standalone build does not find the packages: libcoreclr, libdl, libSystem. This error occurs when the Sidechannel is registered (from the log file):

Plugins: Failed to load 'libcoreclr' because one or more of its dependencies could not be loaded. Grpc.Core.Internal.UnmanagedLibrary:.ctor(String[]) Grpc.Core.Internal.NativeExtension:Load() Grpc.Core.Internal.NativeExtension:.ctor() Grpc.Core.Internal.NativeExtension:Get() Grpc.Core.Internal.NativeMethods:Get() Grpc.Core.GrpcEnvironment:GrpcNativeInit() Grpc.Core.GrpcEnvironment:.ctor() Grpc.Core.GrpcEnvironment:AddRef() Grpc.Core.Channel:.ctor(String, ChannelCredentials, IEnumerable1) Grpc.Core.Channel:.ctor(String, ChannelCredentials) MLAgents.RpcCommunicator:Initialize(UnityOutputProto, UnityInputProto&) (at ****\ml-agents\com.unity.ml-agents\Runtime\Communicator\RpcCommunicator.cs:172) MLAgents.RpcCommunicator:Initialize(CommunicatorInitParameters) (at ****\ml-agents\com.unity.ml-agents\Runtime\Communicator\RpcCommunicator.cs:86) MLAgents.Academy:InitializeEnvironment() (at ****\ml-agents\com.unity.ml-agents\Runtime\Academy.cs:342) MLAgents.Academy:LazyInitialize() (at ****\ml-agents\com.unity.ml-agents\Runtime\Academy.cs:195) MLAgents.Academy:.ctor() (at ****\ml-agents\com.unity.ml-agents\Runtime\Academy.cs:183) MLAgents.<>c:<.cctor>b__70_0() (at ****\ml-agents\com.unity.ml-agents\Runtime\Academy.cs:74) System.Lazy1:CreateValue() System.Lazy1:LazyInitValue() System.Lazy1:get_Value() MLAgents.Academy:get_Instance() (at \ml-agents\com.unity.ml-agents\Runtime\Academy.cs:87) RegisterStringLogSideChannel:Awake() (at \Project\Assets\SideChannel3DBall\RegisterStringLogSideChannel.cs:33)

This error appears as soon as a sidechannel is activate, without sidechannel it is running without errors. The communication from python to unity standalone is working but from unity to python is not, because of the described errors above.

Environment :

NaiveRed commented 4 years ago

I also have this problem. I did not do about the custom side channels but only follow the Learning-Environment-Executable tutorial with ml-agents. Not sure it is a bug in my case, because the training and game seem to work properly. It only appears the message without other errors. image Environment:

andrewcoh commented 4 years ago

Hi @jdP19 @NaiveRed

Are you all actually experiencing issues/crashes or is it just popping up in the logs? Is the training proceeding as expected?

andrewcoh commented 4 years ago

Also, @jdP19 are you on the latest release (v0.14.1) of C# and python? If not, does this issue persist when you switch?

NaiveRed commented 4 years ago

@andrewcoh It just pops up in the log and I think it works fine in the training process. (no other errors)

jdP19 commented 4 years ago

Hi @jdP19 @NaiveRed

Are you all actually experiencing issues/crashes or is it just popping up in the logs? Is the training proceeding as expected?

It is popping up in the logs, the training proceeds expectingly. But the problem is the side channels are not working when you get this issues popping up. I used the custom side channel example provided in the repo, where the unity logs are piped to python and the python logs are piped to unity. The exchange of messages from python to unity is not working.

Also, @jdP19 are you on the latest release (v0.14.1) of C# and python? If not, does this issue persist when you switch?

Yes the issue persist when i use the v0.14.1 and the newest devoplement of the ml-agents repo.

andrewcoh commented 4 years ago

@jdP19 sorry, can you clarify. In your first message, it seemed the communication from unity to python was not working. Now, it's python to unity?

Is the debug log in the editor completely empty?

jdP19 commented 4 years ago

@jdP19 sorry, can you clarify. In your first message, it seemed the communication from unity to python was not working. Now, it's python to unity?

Is the debug log in the editor completely empty?

I wrote something wrong, the way from python to unity is working, but not from untiy to python !!! It only show the error messages: Plugins: Failed to load 'libcoreclr' because one or more of its dependencies could not be loaded.

guillefix commented 4 years ago

I am also getting this issue with ML-Agents 0.15

Mquinn960 commented 4 years ago

@guillefix what step did you take to install the python mlagents package?

I remember getting something like this because I installed via pip remote:

pip install mlagents

This package normally isn't compatible if you have pulled the ML Agents repo, instead you have to install the python packages from the repo, locally. So from within your repo, in a shell:

pip install -e ml-agents pip install -e ml-agents-envs

P.s. If you did install from pip remote (no -e) then you might need to pip uninstall mlagents first.

Any other errors I got when building were just warnings about certain cuda dlls which didn't impede my progress.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity in the last 28 days. It will be closed in the next 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed because it has not had activity in the last 42 days. If this issue is still valid, please ping a maintainer. Thank you for your contributions.

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.