omron-sinicx / neural-astar

Official implementation of "Path Planning using Neural A* Search" (ICML-21)
https://omron-sinicx.github.io/neural-astar
Other
236 stars 57 forks source link

What's the reason behind using initial obstacles_maps of ones and zeros result in IndexError? #20

Closed cisimon7 closed 1 year ago

cisimon7 commented 1 year ago

Hello,

I am wondering what it means when the line throws an error message such as: "IndexError: index -9223372036854775808 is out of bounds for dimension 1 with size 1024"?

You can get this error for example when running the train.py script and setting learn_obstacles=True on line, and initializing map_obstcles to zeros (torch.zeros_like(start_maps)) instead of ones (torch.ones_like(start_maps)) on line. Why does initial obstacles_maps of zeros throw an error?

yonetaniryo commented 1 year ago

Hi! obstacles_maps take 0 for obstacle regions as used here: https://github.com/omron-sinicx/neural-astar/blob/6d88e7ca4c00447862da4650e5b339489371e3c4/src/neural_astar/planner/differentiable_astar.py#L229

so initializing it to zeros means that all regions are obstacles and there are no feasible paths.

cisimon7 commented 1 year ago

Thanks for the quick response. I think I got my answer