Closed taesiri closed 4 years ago
Hi @taesiri, thank you for sharing! This will be useful for others for sure. @unityjeffrey perhaps we can look into linking the tutorial in some way?
Hi @taesiri, this looks really nice! I've tried to walk through your notebook, but on the step of "Activate Unity" I got a few error messages saying "invalid option -- o" etc, so I wasn't able to proceed.
@xiaomaogy, I think you haven't installed Unity yet. Either $UNITY_EXEC
is pointing to the wrong path or you've forgotten to accept the License Agreement.
After executing the above cell, you have to accept the License Agreement by pressing y
in the textbox which appeared bellow the cell.
That being said, It is better to activate Unity using the second method. For some reason passing the password in the command line is problematic.
@taesiri Thanks for the video, I will try again. I was really confused by "Upload ulf file in colab using the left side-bar.", because I wan't able to see the Files tab and switch to it, and the video helped me find it.
@taesiri I was able to go through the whole process and I really like it. I was especially impressed by the convenience of this solution, everything is laid out nicely in just one place. The tensorboard, training console and the files can all be managed in one place (if we can somehow visualize the unity, that would be even better).
Regarding the setup part, aside from a little bit confusion in the license activation part(and the video helped a lot), all of the other steps are really smooth. Nice job!
One thing I'm curious about is you mentioned that this setup helps you save time. Could you please elaborate more on this if you don't mind?
@xiaomaogy I am glad you liked it. I prepared this notebook very quickly, and surely, we can add a better explanation for each cell to reduce confusion.
I also had some thoughts about visualizing Unity's output. I am pretty sure we can add it either through some sort of xvbf
hack or a minor modification in the ml-agents.
About the time-saving part, I like to modify/create different environments, and training agents on them can be time-consuming (I only have two computers). With this setup, I can use COLAB to train more agents simultaneously. The training power part aside, I think it is really convenient to push your C# code changes to the GitHub and let the scripts do the compiling job for you. (After installing Unity in one COLAB session, you can reuse it until the session expires.) Surely one can make a Linux build locally and upload the binaries in COLAB (or in any other Linux servers), but it's time consuming compared to automatic builds. (I also have bad internet connection which makes upload process painful)
Thank you for sharing. I have also successfully used colab.
@xunyiljg I'm glad you liked it 😊.
Just a quick update:
xvbf
gave me a headache so I switched to Xorg virtual desktop. My current notebook is a mess but I will share it after I cleaned it up.Brain
as trainable in the BroadcastHub
directly in COLAB.--no-graphics
flag). For example #1786 marked as closed without any solution or workaround. I will write a tutorial for this later.ffmpeg
to capture the screen. You can just save the video on Google Drive instead.Here is the Link to my updated notebook. It works with the latest beta version of ml-agents 0.11. I should mention that I am really happy with the changes made in this version.
input
interactive widget and let the user choose which see he or she wants to build.You can either train in headless (no graphics) mode or stream the output to Twitch. You can get your stream key here.
I used i3
for managing windows as its super lightweight and easy to work with. You can interact with it through the i3ipc
python package.
Happy Coding!
This issue has been automatically marked as stale because it has not had activity in the last 14 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 28 days. If this issue is still valid, please ping a maintainer. Thank you for your contributions.
@taesiri It doesn't work anymore. See
I think list_of_scenes
needs to be adjusted
# list_of_scenes = list(Path('/content/my-agents/UnitySDK/Assets/ML-Agents/Examples/').rglob('*.unity'))
list_of_scenes = list(Path('/content/my-agents/Project/Assets/ML-Agents/Examples/').rglob('*.unity'))
Then I can choose a scene, but then when I try to build it, I have another error
I feel like there should be a guide on how to build all example envs headlessly... What if I want to train everything in the server where no GUI is available? The current guides do not seem to cover these instructions.
Hi @vwxyzjn.
I do not maintain that notebook anymore as there was little to no feedback from the community. I have a version of this notebook that works with my own fork of mlagents
. You are more than welcome to copy my notebook and fix the issue you mentioned. The master branch is changing rapidly; I strongly suggest to switch to one of the stable release branches.
Some notes for you:
Upgrade the version of Unity to 2019.3, Here is the URL for latest Linux version of Unity
You'll probably run into more issues when compiling a project, I strongly suggest to take a look at this repository. For example, this issue will help you to solve a problem related to the sound card.
Instead of TensorBoard in Colab, Try Tensorboard.dev. (Or you can use WandB)
Cheers, M
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.
Hi Everyone,
I'd like to share my own setup for training ml-agents on COLAB. It is a fairly simple setup but it helped me save some time. I make changes to the environment I want locally and push the changes to Github. After that, I build the environment in the COLAB and train the model I want. I should mention that installing Unity on COLAB and building a project taking 5 up to 15 minutes.
Here is the link to my COLAB notebook
I used some scripts from unity3d-gitlab-ci-example for building the Unity project. For example, I copied and modified BuildCommand.cs into my project. The modification is in the
GetEnabledScenes
method and it's only 1 line. I only return the name of the scene I want to get build.The whole setup is very simple at the moment. If anyone from ml-agent team is interested, I can make a PR with an appropriate
BuildCommand
file and a sample notebook.