Closed justkittenaround closed 2 years ago
Hi @justkittenaround
Can you try calling env.reset()
and then checking this list? Please see my screenshot:
Hi @andrewcoh, thanks for looking into it. env.reset() did not resolve the error. Bellow is the results.
Ah, I see the issue occurs when actually trying to load the executable i.e. the 'is not responding' error. It could be a resolution mismatch.
Can you try setting Fullscreen Mode to 'Windowed' in the player settings when you create your build?
@andrewcoh I have it set to windowed. Here is a screenshot of my player settings. I just want to be sure you know I am working with Ubuntu here. Could it be a Ubuntu issue? I can't get it to work with any scene.
Yep, I'm aware you're using Ubuntu.
I should've asked this earlier (but I think I saw your forum post mentioning this): are you able to get this to run using mlagents-learn
and the --env command?
@andrewcoh thanks for taking that into account. I did originally post on the forum because I thought it might be something I was doing wrong.
I am able to get it training using the mlagents-learn command. The problem is that I want to use my own training algorithm instead of the built in ones. I was under the impression that we can't do that with mlagents-learn, we need to use the mlagents-envs. Is that correct?
Yes, you have that correct and it's not obvious to me just yet that you're doing anything wrong. I'll do some troubleshooting and get back to you.
@andrewcoh I seem to have found a solution. First, the build needs to be in the project folder where I created the scene in unity editor. Secondly, I have to build the executable in debugging mode only. Third, when the environment opens after I call UnityEnvironment with the file name, I have to click "wait" when it crashes instead of "force close".
Thanks for looking into it! Seems a little buggy but glad I got a solution so I can start using the awesome API.
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.
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.
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.
Describe the bug Cannot load custom environment with ml-agents-envs API via UnityEnvironment(). I would like to load my custom environment I built in Unity editor and access it with the ml-agents API so I can train it with my custom learning algorithm in python.
To Reproduce Steps to reproduce the behavior:
Console logs / stack traces
>>>import mlagents
>>>from mlagents_envs.environment import UnityEnvironment as UE
>>>env = UE(file_name = '3DBall_build')
Found path: /home/whale/Unity/ml-agents-release_7/3DBall_build.x86_64
>>>env
<mlagents_envs.environment.UnityEnvironment object at 0x7fbc4a103eb8>
>>>list(env.behavior_specs)
[]
Screenshots see video under reproduce section above
Environment (please complete the following information): I have tried with multiple Unity environments, both my own that I built and examples from the latest release (7) in ml-agents repository. I've also tried uninstalling everything and reinstalling. I've tried with Anaconda and just on local.