agents: Problem with importing the "reverb" package with Tutorial: SAC minitaur with the Actor-Learner API
HI,
I am getting an ImportError when trying to import the “reverb” package as done in the tutorial.
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-38745e83da94> in <module>
4 import matplotlib.pyplot as plt
5 import os
----> 6 import reverb
7 import tempfile
8 import PIL.Image
~/Desktop/AI/ai_venv/lib/python3.7/site-packages/reverb/__init__.py in <module>
25 # pylint: enable=g-bad-import-order
26
---> 27 from reverb import item_selectors as selectors
28 from reverb import rate_limiters
29
~/Desktop/AI/ai_venv/lib/python3.7/site-packages/reverb/item_selectors.py in <module>
17 import functools
18
---> 19 from reverb import pybind
20
21 Fifo = pybind.FifoSelector
~/Desktop/AI/ai_venv/lib/python3.7/site-packages/reverb/pybind.py in <module>
----> 1 import tensorflow as _tf; from .libpybind import *; del _tf
ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
I have tried to export this variable: export LD_LIBRARY_PATH=/home/orie/Desktop/AI/ai_venv/lib/
I have also tried including this environment variable in my python notebook:
import os
os.environ['LD_LIBRARY_PATH'] = '/home/orie/Desktop/AI/ai_venv/lib/'
I also tried:
sudo ldconfig /home/orie/Desktop/AI/ai_venv/lib
I’m using Ubuntu and a virtual environment.
Thx for anyone who helps!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 22 (5 by maintainers)
@EkaterinaAbramova You are correct. @doughazell is also correct; but I will say we do not use those ReplayBuffers anymore. Meaning they do not get a lot of exercise; but that is what we used up until about 1.5 years ago or so when we switched. They are likely just fine for playing around and if they help you go for it.
I would use an AWS machine. I have not tried docker on Mac, but that might be an option. I only read this 3 minutes ago but it seems it is free if are are not using it commercially. https://docs.docker.com/desktop/install/mac-install/
The long answer is we use a replay buffer called reverb that is in c++ and we (DeepMind now Google Deepmind “owns” it; but I do the releases for them and we are very close) do not have enough people to manage a MacOS build. Internally we are linux and that is the best path for support. I would not try to write you own, I would run a linux on something.
This is much more than you want to know; but insight into the people behind the code is often a useful perspective.
@FinAminToastCrunch I added a note to the README.md in the install section a few days ago. Reverb (I realize you would not visit that site) also has a big note about only supporting Linux. Having a note on all of the tutorials feels messy. We only use Linux or linux like systems internally. There was an effort to compile reverb (c++) on OSX; but it didn’t happen and there isn’t an incentive to support it internally. The code is there and anyone is welcome to figure it out; bazel is a bit of a pain which is a rather large barrier to entry. We would still want to setup internal regression testing and presubmits for OSX (Which is kind of a pain).
TF-Agents use to have a python based replay buffer; but we decided to move to Reverb which aligns with ACME and other RL frameworks across Alphabet, e.g. DeepMind. It is an economies of scale situation (we no longer needed to have an engineer supporting and extending the replay buffer) and it meant everyone (across “all” of Alphabet) focused on adding features and performance to the same code base.
I do not mean this in a flippant manner. If your requirement is to run on Windows and OSX, then TF-Agents is not the right choice unless you are just using it for the model code and coming up with a different replay buffer. Reverb as a distributed replay buffer has been testing with 1000s of agents; which doesn’t help your situation but is why we moved.
I honestly wish you luck in finding the right tool for the work you want to accomplish. I didn’t have to respond; and while this doesn’t help you. I hope it gives you some perspective.
According to the Reverb README, “Reverb currently only supports Linux based OSes.”
So if you’re on Windows it’s not going to work 😕
See related issue #695
I also had this issue starting from yesterday. I think it is related to the new tensorflow 2.4
It seems to be working if you install tf 2.3.1 just before installing reverb & tf agents in that colab notebook
Even when I try to run this in the Colab notebook, trying to import reverb is causing this error:
NotFoundError: /usr/local/lib/python3.6/dist-packages/reverb/cc/ops/libgen_dataset_op_gen_op.so: undefined symbol: _ZN10tensorflow4data15DatasetOpKernel11TraceStringEPNS_15OpKernelContextEbThis is from this notebook: https://colab.research.google.com/github/tensorflow/agents/blob/master/docs/tutorials/7_SAC_minitaur_tutorial.ipynb#scrollTo=sMitx5qSgJk1
Great I am glad it worked!
On Tue, 11 Apr 2023, 13:23 Doug Hazell, @.***> wrote:
Thank you for your reply This tutorial from your link (https://github.com/tensorflow/agents/blob/master/docs/tutorials/9_c51_tutorial.ipynb) doesn’t use reverb and works well!
But, shouldn’t that dependency on OS be fixed in the tutorial? I may be mistaken as I don’t have much experience, but for me, it looks like an issue that should be solved by replacing the reverb package with something more cross-platform. Therefore, the basic tutorial would work in Windows as it supposed to be