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

a strange error about '''boost''' library #135

Open
tinmodeHuang opened this issue Nov 29, 2021 · 9 comments
Open

a strange error about '''boost''' library #135

tinmodeHuang opened this issue Nov 29, 2021 · 9 comments

Comments

@tinmodeHuang
Copy link

tinmodeHuang commented Nov 29, 2021

I'm trying to merge the project with my algorithems, but an error popped up when running the one of algorithems, it is so hard for me to locate which code snippet causes the error, so I'm here for help.
the error shows as follow:

python3: external/boost/boost/geometry/index/rtree.hpp:1469: 
void boost::geometry::index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator>::raw_insert(const value_type&) [
with Value = std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian> >, unsigned int>; 
Parameters = boost::geometry::index::linear<16, 4>; 
IndexableGetter = boost::geometry::index::indexable<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian> >, unsigned int> >;
EqualTo = boost::geometry::index::equal_to<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian> >, unsigned int> >; 
Allocator = boost::container::new_allocator<std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian> >, unsigned int> >; 
boost::geometry::index::rtree<Value, Options, IndexableGetter, EqualTo, Allocator>::value_type = std::pair<boost::geometry::model::box<boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian> >, unsigned int>]: 
Assertion `(detail::is_valid(m_members.translator()(value)))&&("Indexable is invalid")' failed.

I'm willing if you ask me to post algorithems for solving it. thanks in advance!

@patrickhart
Copy link
Collaborator

Without additional code or where it goes south this is difficult to debug. I would suggest you to debug into the Python/C++ code. As this error is related with the r-tree (https://github.com/bark-simulator/bark/blob/a5ad1044d40c3aa9600f496f64884bdd325ca9a0/bark/world/world.hpp#L217) it probably means that it is not updated.

@tinmodeHuang
Copy link
Author

the error just occurs sometimes, so it is difficult to debug

@patrickhart
Copy link
Collaborator

That probably means that an agent somehow is not available in the r-tree (possibly it got deleted going out of the map).

@tinmodeHuang
Copy link
Author

after checking the code added by me over and over again and it could work very well in Hopper-v2, it seem to be concluded that there is something wrong in unmodified bark, bark-ml or their virtual environments

@patrickhart
Copy link
Collaborator

All you probably need to do is to set this flag in the JSON:

@tinmodeHuang
Copy link
Author

tinmodeHuang commented Dec 30, 2021

just set it without any content, does it?
if that is it or not, it remains to fail

@tinmodeHuang
Copy link
Author

my code is simple, if you're willing, the error can be reproduced using it.
operations to reproduce the error are as follows:

  1. extract lib_torch_mcdo.zip under /bark_ml/library_wrappers
  2. extract mcdo_rl.zip under /examples
  3. add the snippet below in /examples/BUILD
py_test(
  name = "mcdo_rl",
  srcs = ["mcdo_rl.py"],
  data = ["@bark_project//bark/python_wrapper:core.so",
          "//bark_ml:generate_core",
          "//examples/example_params:example_params"
        ],
  imports = ["../bark_ml/python_wrapper/"],
  deps = [
    "//bark_ml/commons:tracer",
    "//bark_ml/environments:gym",
    "//bark_ml/library_wrappers/lib_torch_mcdo:agents",
  ]
)
  1. run bazel run //examples:mcdo_rl -- --policy MCDO_TD3 --MC_dropout weighted_meanQ --seed 1

@patrickhart
Copy link
Collaborator

The code is not executable since there are many local paths, etc.

To debug the problem, I would recommend:

  1. Run the same environment you want to train in with random actions (if the error does not occur, what does that entail?).
  2. Log the location, episode, action, etc. -> see where the error occurs (most probably when the ego agent or another agent goes out of bounds)
  3. The error most likely has something to do with a removed agent and a non-updated R-tree in BARK.

As I said before, set the parameter params["World"]["remove_agents_out_of_map"] = True for the BARK-ML environment.
This enables the automatic removal of agents that are out-of-bounds.

@tinmodeHuang
Copy link
Author

sorry for that, actually, you just replace /home/tinmode/bark-ml-master in all paths with whatever you want.
thanks for these advices, I'll try to do it as you said.

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

2 participants