Giter Site home page Giter Site logo

Comments (15)

tkoeppe avatar tkoeppe commented on August 15, 2024 1

Try the other binary below ./bazel-bin/struct_runner.runfiles/... somewhere. I'm not entirely sure of the top of my head. The current working directory may be relevant.

from lab.

tkoeppe avatar tkoeppe commented on August 15, 2024 1

I would hope that it works :-)

from lab.

tkoeppe avatar tkoeppe commented on August 15, 2024

Can you run the binary directly without bazel run?

from lab.

edran avatar edran commented on August 15, 2024

As in, by copying over the "library" like suggested in #37?

from lab.

tkoeppe avatar tkoeppe commented on August 15, 2024

No, just by invoking the executable directly. It's somewhere below bazel-bin, have a look.

from lab.

edran avatar edran commented on August 15, 2024
$ ./bazel-bin/struct_runner
Failed to open library! - ./libdmlab.so
./libdmlab.so: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/home/edran/lab/doomstruct/ext/lab/bazel-bin/struct_runner.runfiles/org_deepmind_lab/dev/main.py", line 79, in <module>
    main()
  File "/home/edran/lab/doomstruct/ext/lab/bazel-bin/struct_runner.runfiles/org_deepmind_lab/dev/main.py", line 74, in main
    agents[config.agent], envs[config.env])
  File "/home/edran/lab/doomstruct/src/interface/spawner.py", line 29, in __init__
    dummy_env.setup()
  File "/home/edran/lab/doomstruct/src/interface/lab_interface.py", line 42, in setup
    'height': str(self.args.height)
RuntimeError: Failed to connect RL API

$ cd bazel-bin
$ ./struct_runner
Level not found: Failed to open file './baselab/game_scripts/dev/test_map.lua'
Traceback (most recent call last):
  File "/home/edran/.cache/bazel/_bazel_edran/db1fd2bdda117385e24e1bb01cc56fd6/execroot/lab/bazel-out/local-fastbuild/bin/struct_runner.runfiles/org_deepmind_lab/dev/main.py", line 79, in <module>
    main()
  File "/home/edran/.cache/bazel/_bazel_edran/db1fd2bdda117385e24e1bb01cc56fd6/execroot/lab/bazel-out/local-fastbuild/bin/struct_runner.runfiles/org_deepmind_lab/dev/main.py", line 74, in main
    agents[config.agent], envs[config.env])
  File "/home/edran/lab/doomstruct/src/interface/spawner.py", line 29, in __init__
    dummy_env.setup()
  File "/home/edran/lab/doomstruct/src/interface/lab_interface.py", line 42, in setup
    'height': str(self.args.height)
RuntimeError: Invalid levelName flag 'dev/test_map'

I guess most of the paths are harcoded...

from lab.

edran avatar edran commented on August 15, 2024

If I cd into ./bazel-bin/struct_runner.runfiles/org_deepmind_lab it does indeed seem to spawn processes correctly!

However, how do I then give commands such as --define headless=false?

from lab.

tkoeppe avatar tkoeppe commented on August 15, 2024

The define is a build flag. So you say:

  • bazel build :struct_runner --define headless=false
  • bazel-bin/struct_runner.runfiles/org_deepmind_lab/struct_runner

from lab.

edran avatar edran commented on August 15, 2024

Great, thank you!

Will map creation through the lua api work out of the box if I run things this way, or should I be wary of other such possible issues?

from lab.

edran avatar edran commented on August 15, 2024

Great - going to close the issue then, however it might be worth documenting this stuff somewhere (or to fix bazel ¯\_(ツ)_/¯ ).

from lab.

alversafa avatar alversafa commented on August 15, 2024

This issue seems to be closed more than 2 years ago. However I am having the same problem. (Tried the above solution)

I wrote a wrapper around DMLab to make it more like Gym and in each of the processes that I create, I initialize the environment by using this wrapper. It seems that the processes just die after this initialization of the environments.

What should I do? Thanks.

from lab.

tkoeppe avatar tkoeppe commented on August 15, 2024

Can you give some details (or, preferably, explore yourself) of how you are running your binaries? Do they have access to the required assets?

from lab.

alversafa avatar alversafa commented on August 15, 2024

I am running it as:

bazel build :python_a3c_agent --define headless=osmesa
./bazel-bin/python_a3c_agent.runfiles/org_deepmind_lab/python_a3c_agent

where python_a3c_agent.py is the main file that starts all the processes.

(By the way, I am running bazel through a singularity container.)

How do we check if they have an access?

from lab.

tkoeppe avatar tkoeppe commented on August 15, 2024

Could you explore the output directory structure a bit, i.e everything below bazel-bin/python_a3c_agent.runfiles/org_deepmind_lab? Are the expected files anywhere there?

from lab.

alversafa avatar alversafa commented on August 15, 2024

The expected files seem to be around there. I also implemented the multithreaded version and it seems to be working without any problem.

I have found where the dying is happening: resetting DMLab in created processes. When I create an environment inside python_a3c_agent.py everything is working as expected and I can reset it without any problem. However, inside the processes created by python_a3c_agent.py, after env = deepmind_lab.Lab(...) the processes die right after the env.reset() line.

I found where the problem is happening, however, I have no idea on how to solve it.

from lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.