Error when using DeepQ :(

I to use the stables baselines package instead of the baselines package. After running it i get the following error message. Do i have to install further depencies?
Thank you for your help :slight_smile:

user:~/catkin_ws/src/stable-baselines/stable_baselines/deepq/experiments$ python train_cartpole.py
2020-03-26 14:12:49.229370: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libnvinfer.so.6’; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/home/user/catkin_ws/devel/lib:/home/user/simulation_ws/devel/lib:/home/simulations/public_sim_ws/devel/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/usr/local/cuda-10.2/lib64:/home/user/.catkin_ws_python3/src/TensorRT-7.0.0.11/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/x86_64-linux-gnu/gazebo-7/plugins
2020-03-26 14:12:49.229519: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘libnvinfer_plugin.so.6’; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/home/user/catkin_ws/devel/lib:/home/user/simulation_ws/devel/lib:/home/simulations/public_sim_ws/devel/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/opt/ros/kinetic/share/euslisp/jskeus/eus//Linux64/lib:/usr/local/cuda-10.2/lib64:/home/user/.catkin_ws_python3/src/TensorRT-7.0.0.11/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/lib/x86_64-linux-gnu/gazebo-7/plugins
2020-03-26 14:12:49.229547: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would liketo use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Traceback (most recent call last):
File “train_cartpole.py”, line 5, in
from stable_baselines.deepq import DQN, MlpPolicy
File “/home/user/catkin_ws/src/stable-baselines/stable_baselines/init.py”, line 1, in
from stable_baselines.a2c import A2C
File “/home/user/catkin_ws/src/stable-baselines/stable_baselines/a2c/init.py”, line 1, in
from stable_baselines.a2c.a2c import A2C
File “/home/user/catkin_ws/src/stable-baselines/stable_baselines/a2c/a2c.py”, line 7, in
from stable_baselines import logger
File “/home/user/catkin_ws/src/stable-baselines/stable_baselines/logger.py”, line 17, in
from stable_baselines.common.misc_util import mpi_rank_or_zero
File “/home/user/catkin_ws/src/stable-baselines/stable_baselines/common/init.py”, line 9, in
from stable_baselines.common.cmd_util import make_vec_env
File “/home/user/catkin_ws/src/stable-baselines/stable_baselines/common/cmd_util.py”, line 13, in
from stable_baselines.common.atari_wrappers import make_atari, wrap_deepmind
File “/home/user/catkin_ws/src/stable-baselines/stable_baselines/common/atari_wrappers.py”, line 6, in
import cv2 # pytype:disable=import-error
ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type

Maybe you can give me a little help how to read this error messages.
Do i have to start in the buttom or in the top? Where do i see the main problem? :slight_smile:

Make sure you follow the install instructions exactly. And stable baselines might not have all the things you need. For reading error messages: The Error is at the bottom, and it shows you the hierachie of all the commands and files that got called in order.

I changed to baselines again and had it allready running a few times. Today i wante to start again and it showed me this error:

File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/msproxy.py”, line 123, in getitem
raise KeyError(key)
KeyError: ‘/cartpole_v0/n_actions’

I changed nothing :smiley: and the error just appeared :frowning:

I additionally found out, that it only works after i start and end the normal qlearning script, and then start my deepq script :confused:

This sounds like you’re not loading your parameters into the parameter serverr when doing the deepq. Is the .yaml file getting loaded when you launch your deepq? Make sure that all variables, such as ‘n_actions’ are defined. Either doing it manually, or better, by loading the .yaml file and having all the variables needed defined there.

How do I do this? Im stuck there and would appreciate any help.

Hi,
Where exactly are you stuck? Which part do you struggle with? If it is uploading .yaml file, that should be explained in the lesson. Perhaps you have to go slightly back