Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render in Windows and train in Ubuntu #4

Open
monoluk opened this issue Oct 25, 2019 · 16 comments
Open

Render in Windows and train in Ubuntu #4

monoluk opened this issue Oct 25, 2019 · 16 comments
Assignees

Comments

@monoluk
Copy link

monoluk commented Oct 25, 2019

Hi, I'm very interested in your project and want to try it out. The problem is my GPUs are on an Ubuntu machine, which cannot install Windows. So I have to run the Unreal AirSim on a separated machine (Windows). Could you provide a quick guide on how to setup the path between the two machines? Or any necessary steps.

I'm guessing unreal_host_shared_dir = "" is the key?

Thanks
Ye

@srivatsankrishnan
Copy link
Member

Hi, Thanks for your interest. For starters, I would change the IP address in the settings.py. This IP address should correspond to the IP address of your windows machine where you are trying to render the UE4 environment.

Also based on our experience, the RL training is really not that GPU intensive for the kind of architecture we explored. It is possible that you might actually be able to train faster if you run UE4 and RL training on the same machine. The UE4 has about 30-40% GPU utilization (RTX 2080 TI) which means there is still room to squeeze more performance from a single machine/GPU.

If you are having trouble setting up the RL training on windows (i.e. installing TensorFlow and CUDA drivers etc on windows), I can quickly write up a document or have a wiki page.

@srivatsankrishnan srivatsankrishnan self-assigned this Oct 26, 2019
@monoluk
Copy link
Author

monoluk commented Oct 27, 2019 via email

@monoluk
Copy link
Author

monoluk commented Oct 30, 2019

Hi Srivatsan, when I ran the cmd "python3 collect_data.py", I got an error "ImportError: cannot import name 'initializers' from 'keras.layers' (/home/labuser/documents/anaconda3/lib/python3.7/site-packages/keras/layers/init.py)"

But I checked the init.py file, there is no "initializers" module or method in this file, am I missing something?

Ye

Screenshot from 2019-10-30 14-49-37

@srivatsankrishnan
Copy link
Member

Hi,
It seems like Keras is not installed correctly on your machine. Can you check if the Keras module is installed for python3?

@monoluk
Copy link
Author

monoluk commented Nov 5, 2019

Hi Sri, I figured out the issue, for the latest keras, it seems I need to use "tensorflow.keras" instead of "keras.layers" to import the fertilizers. The issue is gone now.

I took your advice, and changed the ip address in the settings.py file, that's pretty much the only place I can think of to change the ip address. I also modified the path of the "game" part, details as below:

used for game configuration handling

json_file_addr = "Users\yelu\Documents\airlearning-ue4\Content\JsonFiles\EnvGenConfig"
#in windows(remote 192.168.1.104)

used for start, restart and killing the game

game_file = "airlearning\airlearning-ue4\AirLearning.uproject"
#in local(Ubuntu)
unreal_host_shared_dir = ""
unreal_exec = "C:\Program Files\Epic Games\UE_4.18\Engine\Binaries\Win64\UE4Editor.exe"
#in windows(remote 192.168.1.104), not sure how to put the ip address in this path, keep getting #errors

------------------------------------------------------------

-Drone related-

------------------------------------------------------------

#ip = '10.243.49.243'
#ip = '127.0.0.1'
ip = '192.168.1.104'

The result is "can not start the game in a remote machine" , when I ran the collect_data.py file. Any suggestions?

@srivatsankrishnan
Copy link
Member

Hi,
I think one way to approach this is to set up a shared drive on windows. Put the UE4 project on the shared drive and then use the path of the shared directory in the machine_dependent_settings.py file. Specifically, you need to add that path to this variable:
unreal_host_shared_dir = ""

We have tried this and it is known to work. Give this a try and let me know how this goes.
-Sri

@monoluk
Copy link
Author

monoluk commented Nov 15, 2019

Hi Sri,
As advised, I mapped the airsim folder to my ubuntu machine. i.e. airlearning-ue4
to "ue4". I also mapped the unreal engine folder from windows to ubuntu as well, i.e "C:\Program Files\Epic Games\UE_4.18\Engine\Binaries\Win64>UE4Editor.exe " to "Win64" on ubuntu. And changed the path in the settig.py file accordingly.

However, I'm still getting the "can not start the game in a remote machine" error, when I run the airLearning on ubuntu (with/without the airsim running on Windows". Below is the snippet of the settings, would you advise what I did wrong?
Screenshot from 2019-11-14 15-39-03


json_file_addr = "/media/ue4/Content/JsonFiles/EnvGenConfig"
#in windows, mapped to ubuntu

used for start, restart and killing the game

game_file = "/media/ue4/AirLearning.uproject"
#in windows, mapped to ubuntu

unreal_host_shared_dir = "/media/ue4"
unreal_exec = "/media/Win64/UE4Editor.exe"
#in windows this is where the unreal engine is installed, mapped to ubuntu
ip = '130.212.228.51'

@monoluk
Copy link
Author

monoluk commented Dec 6, 2019

Hi Sri,
I'm not sure if you have a chance to take a look at my issue above, appreciate it if you can provide some guidance. Thanks
Ye

@srivatsankrishnan
Copy link
Member

Hi Ye,
Sorry, I missed your previous comment.

When you say mapped UE4 to ubuntu what do you mean?

Ideally, you should do something like this:
https://www.howtogeek.com/176471/how-to-share-files-between-windows-and-linux/

The windows shared drive will have the UE4 repository. The Ubuntu machine will run the RL training. In the setting file, you will give the Windows shared folder path as viewed from Ubuntu along with proper credentials.

Let me know how this goes.
-Sri

@monoluk
Copy link
Author

monoluk commented Dec 20, 2019 via email

@monoluk
Copy link
Author

monoluk commented Jan 7, 2020

Hi Sri,

Sorry that I keep bothering you, I'd appreciate it if you can provide some comment on my post above. Thank you.

Ye

@srivatsankrishnan
Copy link
Member

Hi Ye,
We had to do some kind of scripting to make this work.
Before you try this, did you have any kind of simple test to see a file shared from ubuntu is seen in the shared folder in Windows 10? If this works, then changing the path in the setting file should work.

Can you confirm if this works?
-Sri

@monoluk
Copy link
Author

monoluk commented Jan 17, 2020

Hi Sri,

Thanks for the reply. Yes, I confirm that I can see a file shared from ubuntu is seen in the shared folder in Windows 10, i.e. the sharing is 2-way. I look forward to your further advise.

@srivatsankrishnan
Copy link
Member

Hi Ye,
Okay cool. That is the first step to make sure both the machines can talk to each other.
Now, you have to put the Air Learning UE4 project in the windows shared folder. Just make sure to do sanity checks. For example, from the shared folder, you should be able to open the UE4 project a.

Now in your machine dependent settings file (machine_dependent_settins.py), enter the shared d in the shared path variable (unreal_host_shared_dir). The same applies to the other game-related files.

Let me know how this goes.

@raphajaner
Copy link

Hi guys,
Is there still a chance that you'll export the Air Learning Environment Generator to Linux? IMO this limits the use of your amazing simulator quite a bit...
Best,
Raphael

@qinglong0276
Copy link

Can it run on Ubuntu now? @srivatsankrishnan @raphajaner @monoluk @plancherb1 @RadhikaG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants