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

Failed to find function dmlab_connect in library! #209

Open
bebbo203 opened this issue Feb 16, 2021 · 8 comments
Open

Failed to find function dmlab_connect in library! #209

bebbo203 opened this issue Feb 16, 2021 · 8 comments

Comments

@bebbo203
Copy link

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

@tkoeppe
Copy link
Collaborator

tkoeppe commented Feb 16, 2021

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.

@bebbo203
Copy link
Author

Thank you but can you be more specific? After following the guide for installation, what folder should I pass to the function?

@tkoeppe
Copy link
Collaborator

tkoeppe commented Feb 19, 2021

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.

@varshantdhar
Copy link

I'm sorry @tkoeppe I don't understand your answer to the question.

@tkoeppe
Copy link
Collaborator

tkoeppe commented Apr 12, 2021

@varshantdhar: Can you help me understand where my answer falls short and what else you need to know?

@o00000o
Copy link

o00000o commented Oct 21, 2021

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

hi,I have the same problem. Have you solved it?

@o00000o
Copy link

o00000o commented Oct 21, 2021

I'm sorry @tkoeppe I don't understand your answer to the question.

hi,I have the same problem. Have you solved it?

@o00000o
Copy link

o00000o commented Oct 21, 2021

@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

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