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

The error when i run this project in ROS demo! #8

Open
makangzhe opened this issue Apr 19, 2021 · 2 comments
Open

The error when i run this project in ROS demo! #8

makangzhe opened this issue Apr 19, 2021 · 2 comments

Comments

@makangzhe
Copy link

makangzhe commented Apr 19, 2021

I can run this demo in python3 ,but when i reinstall the env by running conda env create -f pose_rbpf_env_py2.yml and recmake this project ,i run ./scripts/run_demo.sh again , the error occured

Traceback (most recent call last): File "test_prbpf_rgbd.py", line 123, in <module> pose_rbpf.run_dataset(dataset_test, args.n_seq, only_track_kf=False, kf_skip=1, demo=args.demo) File "/home/hp1/catkin_ws/src/PoseRBPF/pose_rbpf/pose_rbpf.py", line 1410, in run_dataset self.process_poserbpf(images[0], intrinsics, depth=depth_data) File "/home/hp1/catkin_ws/src/PoseRBPF/pose_rbpf/pose_rbpf.py", line 983, in process_poserbpf self.rbpf.weights = np.nan_to_num(self.rbpf.weights, nan=1e-6, posinf=1.0, neginf=1e-6) TypeError: nan_to_num() got an unexpected keyword argument 'nan'

when i try to run './scripts/run_ros_demo_posecnn.sh'

Traceback (most recent call last): File "./ros/start_posecnn_ros.py", line 502, in <module> network = networks.__dict__[args.network_name](dataset.num_classes, cfg.TRAIN.NUM_UNITS, network_data).cuda(device=cfg.device) KeyError: 'posecnn'

where place should i put PoseCNN weights ? maybe i just put it in the wrong place,i don't know

can you help me ? thank you very much

@adamconkey
Copy link

adamconkey commented Aug 28, 2021

@makangzhe I had to do two things to fix the latter problem when running the ROS posecnn demo:

  1. Uncomment the line from .PoseCNN import * from the file PoseRBPF/networks/__init__.py
  2. The following:
cd PoseRBPF/utils
python setup.py build_ext --inplace

@adamconkey
Copy link

adamconkey commented Aug 28, 2021

@makangzhe regarding your first problem, I had to change line 983 in PoseRBPF/pose_rbpf/pose_rbpf.py from

self.rbpf.weights = np.nan_to_num(self.rbpf.weights, nan=1e-6, posinf=1.0, neginf=1e-6)

to this:

self.rbpf.weights = np.nan_to_num(self.rbpf.weights)

The reason is the function np.nan_to_num has changed its signature in Python3 to include extra args nan, posinf, neginf while the function in Python2 only takes the value x as input.

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