Giter Site home page Giter Site logo

ROS inference file "multi_sweep_inference.py" bad callback: <function rslidar_callback at 0x7fdebadcf2f0> IndexError: invalid index to scalar variable about centerpoint HOT 17 CLOSED

tianweiy avatar tianweiy commented on August 27, 2024
ROS inference file "multi_sweep_inference.py" bad callback: IndexError: invalid index to scalar variable

from centerpoint.

Comments (17)

tianweiy avatar tianweiy commented on August 27, 2024 1

glad to hear. Pillar is our fastest / most inaccurate model so you can try other stronger model like https://github.com/tianweiy/CenterPoint/blob/master/configs/centerpoint/nusc_centerpoint_voxelnet_01voxel.py You also want to tune this function to get desired number of output

def remove_low_score_nu(image_anno, thresh):

from centerpoint.

tianweiy avatar tianweiy commented on August 27, 2024 1

not sure about rivz details. Tracking is just detection + ID so I guess it is possible.

from centerpoint.

tianweiy avatar tianweiy commented on August 27, 2024

@iamsiddhantsahu at

Change to shape = [grid_size]

from centerpoint.

iamsiddhantsahu avatar iamsiddhantsahu commented on August 27, 2024

@tianweiy Yes, I have already tried that, but still getting this error

[ERROR] [1595862420.362335]: bad callback: <function rslidar_callback at 0x7f56679602f0>
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/siddhantsahu/centerpoint_p3_ws/src/centerpoint_ros_node/src/tools/multi_sweep_inference.py", line 339, in rslidar_callback
    scores, dt_box_lidar, types = proc_1.run()
  File "/home/siddhantsahu/centerpoint_p3_ws/src/centerpoint_ros_node/src/tools/multi_sweep_inference.py", line 192, in run
    outputs = self.net(self.inputs)[0] #this is where the error is
  File "/home/siddhantsahu/miniconda3/envs/centerpoint/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/siddhantsahu/Desktop/CenterPoint/det3d/models/detectors/point_pillars.py", line 52, in forward
    return self.bbox_head.loss(example, preds)
  File "/home/siddhantsahu/Desktop/CenterPoint/det3d/models/bbox_heads/mg_head.py", line 1294, in loss
    hm_loss = self.crit(preds_dict['hm'], example['hm'][task_id])
KeyError: 'hm'

from centerpoint.

tianweiy avatar tianweiy commented on August 27, 2024

change

outputs = self.net(self.inputs)[0]

to

outputs = self.net(self.inputs, return_loss=False)[0] 

from centerpoint.

iamsiddhantsahu avatar iamsiddhantsahu commented on August 27, 2024

Still

[ERROR] [1595862876.321550]: bad callback: <function rslidar_callback at 0x7f56497ac2f0>
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/home/siddhantsahu/centerpoint_p3_ws/src/centerpoint_ros_node/src/tools/multi_sweep_inference.py", line 339, in rslidar_callback
    scores, dt_box_lidar, types = proc_1.run()
  File "/home/siddhantsahu/centerpoint_p3_ws/src/centerpoint_ros_node/src/tools/multi_sweep_inference.py", line 192, in run
    outputs = self.net(self.inputs, return_loss=False)[0] #this is where the error is
  File "/home/siddhantsahu/miniconda3/envs/centerpoint/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/siddhantsahu/Desktop/CenterPoint/det3d/models/detectors/point_pillars.py", line 54, in forward
    return self.bbox_head.predict(example, preds, self.test_cfg)
  File "/home/siddhantsahu/Desktop/CenterPoint/det3d/models/bbox_heads/mg_head.py", line 1459, in predict
    task_id=task_id
  File "/home/siddhantsahu/Desktop/CenterPoint/det3d/core/utils/center_utils.py", line 392, in ddd_decode
    keep = _circle_nms(boxes, min_radius=cfg.min_radius[task_id], post_max_size=cfg.post_max_size)
  File "/home/siddhantsahu/Desktop/CenterPoint/det3d/core/utils/center_utils.py", line 274, in _circle_nms
    keep = np.array(circle_nms(boxes.cpu().numpy(), thresh=min_radius))[:post_max_size]
RuntimeError: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead.

from centerpoint.

tianweiy avatar tianweiy commented on August 27, 2024
        with torch.no_grad():
            outputs = self.net(self.inputs, return_loss=False)[0]

from centerpoint.

tianweiy avatar tianweiy commented on August 27, 2024

Are there still any other errors?

from centerpoint.

iamsiddhantsahu avatar iamsiddhantsahu commented on August 27, 2024

@tianweiy Thanks a lot! Yes, there are no errors now and the predictions also seems to match with the annotation ground truth. But there appears to be more number of unnecessary predicted boxes.

The transparent boxes are ground truth and solid ones are predicted. I am using the centerpoint_pillar_512 trained model.

Screenshot from 2020-07-27 21-08-57

from centerpoint.

iamsiddhantsahu avatar iamsiddhantsahu commented on August 27, 2024

Sure, will try with the best trained models. Fine tuning the thresh definitely helps.
The model which I tried nusc_centerpoint_pp_02voxel_circle_nms_demo is it only detection or detection + tracking as well? Can I try to use the centerpoint_voxel_1440_dcn_flip(Rotated NMS) tracking model and other tracking pre-trained models well?

from centerpoint.

tianweiy avatar tianweiy commented on August 27, 2024

only detection. Tracking script is here. You can use all pre-trained models but currently, the two ros scripts don't support the flip data augmentation.

from centerpoint.

iamsiddhantsahu avatar iamsiddhantsahu commented on August 27, 2024

In addition to detection can tracking be visualized in ROS rivz as well?

from centerpoint.

muzi2045 avatar muzi2045 commented on August 27, 2024

check the id info in output tensor and add it in visual box.

from centerpoint.

iamsiddhantsahu avatar iamsiddhantsahu commented on August 27, 2024

@muzi2045 Thanks for suggesting. Should a new ROS topic needs to created and the id data needs to be published there or it can be published to an existing ROS topic? And how to visualize the respective id over their bounding boxes?

from centerpoint.

YoushaaMurhij avatar YoushaaMurhij commented on August 27, 2024

check the id info in output tensor and add it in visual box.

The output tensor contains box3d_lidar, scores and label_preds. There is no id info. Can you provide more information, please?

from centerpoint.

tianweiy avatar tianweiy commented on August 27, 2024

@YoushaaMurhij Yeah, no id info in the tensor. You need to follow the tools/tracking/pub_test.py to also generate id info in the ros inference file.

from centerpoint.

xavidzo avatar xavidzo commented on August 27, 2024

@tianweiy Thanks a lot! Yes, there are no errors now and the predictions also seems to match with the annotation ground truth. But there appears to be more number of unnecessary predicted boxes.

The transparent boxes are ground truth and solid ones are predicted. I am using the centerpoint_pillar_512 trained model.

Screenshot from 2020-07-27 21-08-57

HI @iamsiddhantsahu, one queston: I tried to reproduce the visualization of this screenshot in rviz, but only the predicted bounding boxes (i.e. only solid boxes) are shown, which come from the / pp_boxes topic. How did you manage to display also the ground truth boxes (transparent ones) at the same time? I didn't see any other topic from the rosbag file publishing this information.
I would appreciate your help, thanks.

from centerpoint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.