Failed to find function dmlab_connect in library!
bebbo203 opened this issue · 8 comments
While the command
bazel run :python_random_agent --define graphics=sdl -- \ --length=10000 --width=640 --height=480
works perfectly inside the lab folder,
the command python python/random_agent.py
returns this error:
Failed to find function dmlab_connect in library! Traceback (most recent call last): File "python/random_agent.py", line 206, in <module> args.record, args.demo, args.demofiles, args.video) File "python/random_agent.py", line 155, in run env = deepmind_lab.Lab(level, ['RGB_INTERLEAVED'], config=config) RuntimeError: Failed to connect RL API
How to solve? Thank you
Right, the runfiles directory needs to be made known to the Python module. When you run the executable via Bazel, then the hardcoded default is correct (https://github.com/deepmind/lab/blob/master/python/dmlab_module.c#L941), but if you run it from elsewhere you need to manually set it. For example, see how https://github.com/deepmind/lab/blob/master/python/dmenv_module.py#L25-L27 does it.
Thank you but can you be more specific? After following the guide for installation, what folder should I pass to the function?
The runfiles path is passed to the DSO loader parameters: https://github.com/deepmind/lab/blob/master/python/dmlab_module.c#L187
Those parameters are used to locate the .so
files:
https://github.com/deepmind/lab/blob/master/public/dmlab_so_loader.cc#L205-L212
So the path needs to be wherever libdmlab_headless_sw.so etc. are. If you use Bazel to build everything, that will the the directory that we've hardcoded (basically <binary_name>.runfiles/org_deepmind_lab
), but if you're running this in some other way, you need to point it at the right directory.
I'm sorry @tkoeppe I don't understand your answer to the question.
@varshantdhar: Can you help me understand where my answer falls short and what else you need to know?
While the command
bazel run :python_random_agent --define graphics=sdl -- \ --length=10000 --width=640 --height=480
works perfectly inside the lab folder, the commandpython python/random_agent.py
returns this error:
Failed to find function dmlab_connect in library! Traceback (most recent call last): File "python/random_agent.py", line 206, in <module> args.record, args.demo, args.demofiles, args.video) File "python/random_agent.py", line 155, in run env = deepmind_lab.Lab(level, ['RGB_INTERLEAVED'], config=config) RuntimeError: Failed to connect RL API
How to solve? Thank you
hi,I have the same problem. Have you solved it?
I'm sorry @tkoeppe I don't understand your answer to the question.
hi,I have the same problem. Have you solved it?
@varshantdhar: Can you help me understand where my answer falls short and what else you need to know?
hi,I have the same problem.I don't know what you mean.For example, how do I solve this problem by running this code. bazel run :python_random_agent