Skip to content

Replace removed cp.bool8 with cp.bool_ in SemanticMap - #149

Open
mktk1117 wants to merge 1 commit into
leggedrobotics:mainfrom
mktk1117:fix/cupy-bool8
Open

mktk1117 wants to merge 1 commit into
leggedrobotics:mainfrom
mktk1117:fix/cupy-bool8

Conversation

@mktk1117

Copy link
Copy Markdown
Contributor

Problem

SemanticMap creates delete_new_layers with cp.bool8. CuPy mirrors NumPy's aliases, and NumPy 2 removed bool8, so any map with semantic layers fails at construction:

AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?

Fix

Use cp.bool_ (two places in semantic_map.py). It is the same dtype and exists in every CuPy version.

Testing

elevation_mapping_cupy/script/elevation_mapping_cupy/tests with CuPy 13.6 and NumPy 2:

  • Before: 87 errors, all of them this bool8 AttributeError.
  • After: no bool8 errors. The remaining failures were already masked before this change, and are not caused by it:
    • tests load ../../../config/weights.dat and plugin_config.yaml from paths that don't exist;
    • tests call SemanticMap methods that were renamed or removed (get_fusion_of_pcl, get_indices_fusion signature).

I also ran a full replay through ElevationMap.input_pointcloud / input_image with semantic image layers on main with this change.

Separate note, not changed here: main's CUDA kernels use CuPy's float16 device type, which no longer compiles with CuPy 14, so main needs CuPy 13 or older.

cupy.bool8 follows numpy.bool8, which NumPy 2 removed, so creating a
SemanticMap fails with AttributeError on current CuPy. cp.bool_ is the
same dtype and exists in every CuPy version.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant