openxrlab / xrdslam

Platform for Deep Learning based SLAM
Apache License 2.0
114 stars 9 forks source link

run error #3

Open qinkai0127 opened 4 months ago

qinkai0127 commented 4 months ago

hello,when i run ds-run nice-slam --data data/replica/Replica/office0 --data-type replic,errors are belowed [11:00:54] Saving config to: outputs/config.yml xrdslamer.py:41 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [1:38:24<00:00, 24.70s/it][W CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [1:38:26<00:00, 2.95s/it] Starting re-rendering frames... 0%| | 0/2000 [00:00<?, ?it/s][W CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors] 0%| | 0/2000 [00:12<?, ?it/s] Process Process-3: Traceback (most recent call last): File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, self._kwargs) File "/home/qk/xrdslam/slam/pipeline/tracker.py", line 160, in spin self.save_re_render_frames(algorithm) File "/home/qk/xrdslam/slam/pipeline/tracker.py", line 302, in save_re_render_frames result_2d = save_render_imgs(idx_np, File "/home/qk/xrdslam/slam/common/common.py", line 536, in save_render_imgs plt.savefig(f'{img_save_dir}/{idx:05d}.jpg', File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/pyplot.py", line 1223, in savefig res = fig.savefig(args, kwargs) # type: ignore[func-returns-value] File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/figure.py", line 3388, in savefig self.canvas.print_figure(fname, kwargs) File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/backend_bases.py", line 2189, in print_figure self.figure.draw(renderer) File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/artist.py", line 95, in draw_wrapper result = draw(artist, renderer, args, kwargs) File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/artist.py", line 72, in draw_wrapper return draw(artist, renderer) File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/figure.py", line 3155, in draw mimage._draw_list_compositing_images( File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/image.py", line 132, in _draw_list_compositing_images a.draw(renderer) File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/artist.py", line 72, in draw_wrapper return draw(artist, renderer) File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 3109, in draw mimage._draw_list_compositing_images( File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/image.py", line 132, in _draw_list_compositing_images a.draw(renderer) File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/artist.py", line 72, in draw_wrapper return draw(artist, renderer) File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/image.py", line 653, in draw im, l, b, trans = self.make_image( File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/image.py", line 952, in make_image return self._make_image(self._A, bbox, transformed_bbox, clip, File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/image.py", line 567, in _make_image output = _resample( # resample rgb channels File "/home/qk/anaconda3/envs/xrdslam/lib/python3.10/site-packages/matplotlib/image.py", line 208, in _resample _image.resample(data, out, transform, ValueError: arrays must be of dtype byte, short, float32 or float64

wangxiaomeng030 commented 4 months ago

It seems like the save_render_imgs function is encountering an error while saving the images. I was unable to reproduce this issue.

You can set save_debug_result=True in the input_config.py under the nice-slam method to debug this issue.

In the save_render_imgs function,

print("color_np data type:", color_np.dtype) print("color_residual data type:", color_residual.dtype) print("gt_color_np data type:", gt_color_np.dtype) print("gt_depth_np data type:", gt_depth_np.dtype) print("depth_np data type:", depth_np.dtype) print("depth_residual data type:", depth_residual.dtype)

If they are not of type byte, float32, or float64, they need to be converted For example: color_np = color_np.astype(np.float32) color_residual = color_residual.astype(np.float32)

Aaron-0303 commented 4 months ago

We encountered the same issue while running voxFusion. Is this a bug in the code?

qinkai0127 commented 4 months ago

We encountered the same issue while running voxFusion. Is this a bug in the code?

i don't know. But i changed the type of data as float64,it succeed.