manurare / 360monodepth

Code release for 360monodepth. With our framework we achieve monocular depth estimation for high resolution 360° images based on aligning and blending perspective depth maps.
https://manurare.github.io/360monodepth/
MIT License
159 stars 33 forks source link

Struggeling with docker #21

Closed Thryrallo closed 7 months ago

Thryrallo commented 7 months ago

Hi, I really hoped I could get it to work on my own, but I've been struggling. I tried installing it with wsl2 & docker desktop, but that didn't work. I tried building it on windows and that after hours 'make' failed. I actually almost got it with wsl2 ubuntu, but there were some weird warnings when makeing the build.

Anyways, i thought I finally got it with the docker build in wsl2 ubuntu. And it seemed to have built it correctly, it didn't seem to throw any errors. But trying to run it with the included test data I am getting the error I included.

I would appreciate it if anyone knew how to fix my issue.

`(360monodepth) vanessa@Vanessa-Workstation:/mnt/d/Uni/Master/linux/docker/360monodepth$ docker run -it --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 360monodepth sh -c "cd /monodepth/code/python/src; python3 main.py --expname test_experiment --blending_method all --grid_size 8x7"

========== == CUDA ==

CUDA Version 11.4.3

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License. By pulling and using the container, you accept the terms and conditions of this license: https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

Adding '/monodepth/code/python/src' to sys.path 2024-04-18 15:34:29,861 - utility.depthmap_align - INFO - depthmapAlign python module installed! ----------------- Options --------------- available_steps: [1, 2, 3, 4] [default: None] blending_method: all [default: poisson] coeff_fixed_face_index: -1 [default: None] data_fns: ../../../data/erp_00_data.txt [default: None] dataset_matterport_blur_area_height: 0 [default: None] dataset_matterport_blurarea_shape: circle [default: None] dataset_matterport_hexagon_mask_enable: False [default: None] debug_enable: False [default: None] debug_output_dir: None dispalign_align_coeff_grid_height: 7 [default: None] dispalign_align_coeff_grid_width: 8 [default: None] dispalign_ceres_max_linear_solver_iterations: 10 [default: None] dispalign_corr_thread_number: 10 [default: None] dispalign_debug_enable: False [default: None] dispalign_iter_num: 100 [default: None] dispalign_method: group [default: None] dispalign_output_dir: None dispalign_pixelcorr_downsample_ratio: 0.001 [default: None] dispalign_pyramid_layer_number: 1 [default: None] dispalign_weight_project: 1.0 [default: None] dispalign_weight_scale: 0.007 [default: None] dispalign_weight_smooth: 40.0 [default: None] expname: test_experiment [default: monodepth] grid_search: False multi_res_grid: False [default: None] parser: ArgumentParser(prog='main.py', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True) [default: None] persp_monodepth: midas2 rm_debug_folder: True sample_size: 0 subimage_available_list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] [default: None] subimage_padding_size: 0.3 [default: None] subimage_tangent_image_width: 400 [default: None] test: False [default: None] ----------------- Options End ------------------- Set filename prefix: 0001_rgb Set file root dir: ../../../data/erp_00/debug/ 2024-04-18 15:34:29,883 - main - INFO - 1) load ERP image & project to 20 face images 2024-04-18 15:34:29,883 - utility.projection_icosahedron - DEBUG - Generate rectangle tangent image. 2024-04-18 15:34:29,883 - utility.projection_icosahedron - INFO - project ERP image 3 channels RGB map 2024-04-18 15:34:29,883 - utility.projection_icosahedron - DEBUG - generate the tangent image 0 Traceback (most recent call last): File "main.py", line 557, in monodepth_360(opt) File "main.py", line 486, in monodepth_360 estimated_depthmap, times = depthmap_estimation(erp_rgb_image_data, fnc, opt, blend_it, iter) File "main.py", line 170, in depthmap_estimation subimage_rgblist, , points_gnomocoord = proj_ico.erp2ico_image(erp_rgb_image_data, File "/monodepth/code/python/src/utility/projection_icosahedron.py", line 270, in erp2ico_image triangle_param = get_icosahedron_parameters(triangle_index, padding_size) File "/monodepth/code/python/src/utility/projection_icosahedron.py", line 149, in get_icosahedron_parameters triangle_points_tangent_pading = polygon.enlarge_polygon(triangle_points_tangent, padding_size) File "/monodepth/code/python/src/utility/polygon.py", line 88, in enlarge_polygon v1 = np.array([old_points[j][0] - old_points[i][0], old_points[j][1] - old_points[i][1]], np.float) File "/usr/local/lib/python3.8/dist-packages/numpy/init.py", line 305, in getattr raise AttributeError(__former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations`

image

manurare commented 7 months ago

Hello,

You have a too new numpy version. Either you need to downgrade it or remove every np.float for float instead

Thryrallo commented 7 months ago

Hi, yeah, I figured it out. Had to change the python code. floats, bools, and ints. Only after I figured it out, I realized every fork of this project has a "fixed numpy" commit at the beginning 😂 I am so happy it's running now.

I am a little confused as to why that happened. I thought the idea of docker is that you don't meet specific requirements, but that the image has all the configured correctly. Oh well, whatever.