bark-ml
bark-ml copied to clipboard
a strange error about '''boost''' library
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!
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.
the error just occurs sometimes, so it is difficult to debug
That probably means that an agent somehow is not available in the r-tree (possibly it got deleted going out of the map).
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
All you probably need to do is to set this flag in the JSON: https://github.com/bark-simulator/bark-ml/blob/2fc969e5fa542f6ef02a67069a1b1c2be5ea788c/bark_ml/experiment/data/highway_gnn.json#L170
just set it without any content, does it? if that is it or not, it remains to fail
my code is simple, if you're willing, the error can be reproduced using it. operations to reproduce the error are as follows:
- extract lib_torch_mcdo.zip under
/bark_ml/library_wrappers
- extract mcdo_rl.zip under
/examples
- 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",
]
)
- run
bazel run //examples:mcdo_rl -- --policy MCDO_TD3 --MC_dropout weighted_meanQ --seed 1
The code is not executable since there are many local paths, etc.
To debug the problem, I would recommend:
- Run the same environment you want to train in with random actions (if the error does not occur, what does that entail?).
- Log the location, episode, action, etc. -> see where the error occurs (most probably when the ego agent or another agent goes out of bounds)
- 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.
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.