openai / neural-mmo

Code for the paper "Neural MMO: A Massively Multiagent Game Environment for Training and Evaluating Intelligent Agents"

Home Page:https://openai.com/blog/neural-mmo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

neural-mmo does not work on Windows

m-bouville opened this issue · comments

#2 pointed out difficulties with the Ray library. As far as I know, it is not available at all for Windows, cf. https://news.ycombinator.com/item?id=16512784

Plan A would be to make neural-mmo run normally on Windows. This is probably more trouble than it is worth (porting Ray or finding an alternative).

Plan B would be to salvage what can be, ensuring that setup.py runs even without Ray. Of course, this option makes sense only if, say, some rendering is missing, not the core model (as I could not finish said setup, I don't know what would still be working).

Plan C would be informing Windows users that neural-mmo is not going to work (so that they save the trouble to try).

It's about 10-20 lines worth of modifications to just delete everything ray related. All ray does is distribute operations across multiple workers. Just delete the decorators and the .remote() extension to function calls. I am in the middle of working on a major content pass and do not know a good way to conditionally enable ray off the top of my head -- hopefully this should tide over very eager Windows users for now. I'll keep this open so I don't forget to add it to my todo's. Just to be clear: is this the only missing dependency for Windows, or does the rabbit hole go deeper?

Also probably unrelated:
terrain.py:85: DeprecationWarning: imread is deprecated!
imread is deprecated in SciPy 1.0.0, and will be removed in 1.2.0.
Use imageio.imread instead.

I am one step closer. After installing pygame and autobahn by hand, creating a symlink for embyr and playing wack a ray in the code: I manage to start something. The display of uptime and ticks looks promising.

But when I try to render I get Created a server, a bunch of parameters and Connection closed right away (code does not stop running though). FF displays "neural mmo client" and instructions, but nothing happens when I click. If the code is not running at the time I get "unable to connect" (probably expected behavior).

Unable to connect is expected if the server isn't running. There are two ways I normally fix these types of issues getting the client running

  1. What's the output of the web dev mode on your browser? Obvious issues usually show up there
  2. If that doesn't work, hit a T() around line 60in twistedserver.py, in the onConnect method. (T() is my macro for setting a breakpoint. It's defined at the top of the file)

Let me know what pops up!

With T() in twistedserver.py at the end of onConnect method. In FF console:

THREE.WebGLRenderer 103 three.js:22661:3
THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0 three.js:5645:6
Error: WebGL warning: clear: Backbuffer resize failed. Losing context. three.js:23137:4
THREE.WebGLRenderer: Context Lost. three.js:23183:4
Firefox can’t establish a connection to the server at ws://localhost:8080/ws. comms.js:3:9
OBJLoader: 78ms OBJLoader.js:787:4
etc.

Apparently it's not a problem with the rendering itself, but with the data it receives.

Okay, yes, that means that something is horrifically wrong. Around line 64 there should be a call to serverPacket() that gets the data to be sent to the client. There is also one other small function, visVals, which is used to get the value function overlay data. My guess is that the output of serverPacket isn't going to be what you'd expect (a clean dict of param values). This ought to be tracable to one of the returns where you replaced the ray calls. E.g if it is none, maybe one of the functions is no longer returning etc. Let me know if that helps! I'm more than happy to continue helping debug -- sorry I can't put together a patch myself. Conditional enabling of Ray isn't something I know how to do cleanly at the moment, and I'm in the middle of a really big patch on the neural net side.

I don' know what I changed but it works.

FYI: One thing I changed was to close everything to free RAM and to increase paging space on disk. So perhaps the problem was that some calculation failed silently due to lack of memory, returning a bunch of empty matrices.

Do we still need Ray library? Does it still not available for windows?