direct_visual_lidar_calibration icon indicating copy to clipboard operation
direct_visual_lidar_calibration copied to clipboard

Initial guess (Automatic) in Docker

Open Prabuddhi-05 opened this issue 1 year ago • 22 comments

In the Docker image of your repository in ROS2, could you please inform me about how "Initial guess Automatic" (initial_guess_auto) works? I'm encountering an error when testing it. Screenshot from 2024-05-16 16-03-22

Prabuddhi-05 avatar May 16 '24 15:05 Prabuddhi-05

Is there a file named "*_matches.json" in the preprocessed directory? If not, you have to run find_matches_superglue.py.

koide3 avatar May 27 '24 09:05 koide3

Is there a file named "*_matches.json" in the preprocessed directory? If not, you have to run find_matches_superglue.py.

Thank you for the response. However, they still ask us to install things like Torch, Matplotlib, etc. Screenshot from 2024-05-28 13-03-05

Prabuddhi-05 avatar May 28 '24 14:05 Prabuddhi-05

Seems like the torch package was not sucessfully deployed into the container after pulling the image. Can you remove the original docker container and repull the image to see if there is any error about torch installation? Thanks.

Seekerzero avatar Jun 13 '24 13:06 Seekerzero

As per your request, I removed the original Docker container and repulled the image. Unfortunately, the torch package still seems to be missing or not installed correctly. I am still getting the same error.

Prabuddhi-05 avatar Jun 15 '24 10:06 Prabuddhi-05

could you try to post the installation log to here?

Seekerzero avatar Jun 23 '24 14:06 Seekerzero

@Seekerzero i have same error

Davabbb avatar Jun 24 '24 11:06 Davabbb

Hi @koide3, seems like the GTSAM docker files does not setup the python environment properly. maybe add the following # Install PyTorch and torchvision RUN pip3 install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu111/torch_stable.html at here (also the humble one) can ensure the installation.

Thanks.

Seekerzero avatar Jun 25 '24 08:06 Seekerzero

@Seekerzero I created a docker based on yours and there are still not enough modules there

Davabbb avatar Jun 25 '24 08:06 Davabbb

and there is an old docker file on github, here is an updated version, but it still doesn’t work for me https://hub.docker.com/r/koide3/direct_visual_lidar_calibration

Davabbb avatar Jun 25 '24 08:06 Davabbb

Thanks for your information. Do you have any errors report while you installing torch in docker?

Seekerzero avatar Jun 25 '24 09:06 Seekerzero

@Seekerzero thanks for your quick response my dockerfile: FROM koide3/direct_visual_lidar_calibration:humble

RUN apt-get update && apt-get install -y python3-pip

RUN pip3 install numpy==1.21.0 RUN pip3 install torch RUN pip3 install opencv-python RUN pip3 install matplotlib RUN pip3 install torchvision RUN pip3 install models I installed the modules that were needed step by step, but on the 8 layer i have error:

[8/8] RUN pip3 install models:
0.929 Collecting models
1.131 Downloading models-0.9.3.tar.gz (16 kB)
1.189 Preparing metadata (setup.py): started 1.354 Preparing metadata (setup.py): finished with status 'error' 1.362 error: subprocess-exited-with-error 1.362
1.362 × python setup.py egg_info did not run successfully. 1.362 │ exit code: 1 1.362 ╰─> [8 lines of output] 1.362 Traceback (most recent call last): 1.362 File "", line 2, in 1.362 File "", line 34, in 1.362 File "/tmp/pip-install-9_hqdy_l/models_7c2cba2a7c3b46c897307929c70d7580/setup.py", line 25, in 1.362 import models 1.362 File "/tmp/pip-install-9_hqdy_l/models_7c2cba2a7c3b46c897307929c70d7580/models/init.py", line 23, in 1.362 from base import * 1.362 ModuleNotFoundError: No module named 'base' 1.362 [end of output] 1.362
1.362 note: This error originates from a subprocess, and is likely not a problem with pip. 1.364 error: metadata-generation-failed

and i dont have idea how it solve

Davabbb avatar Jun 25 '24 09:06 Davabbb

This might be related to the version of pip3 and setuptools try to upgrade them first.

Seekerzero avatar Jun 25 '24 10:06 Seekerzero

i solve problem with models, clone this repo https://github.com/magicleap/SuperGluePretrainedNetwork/tree/master and copy models folder

Davabbb avatar Jun 25 '24 10:06 Davabbb

this is the version problem with matplotlib, either you can downgrade it (might cause problem with numpy) or you just edit the code to adapt the newer version.

Seekerzero avatar Jun 25 '24 10:06 Seekerzero

try install matplotlib 3.4.0

Davabbb avatar Jun 25 '24 10:06 Davabbb

git clone https://github.com/magicleap/SuperGluePretrainedNetwork/tree/master

FROM koide3/direct_visual_lidar_calibration:humble

RUN apt-get update && apt-get install -y python3-pip

RUN pip3 install numpy==1.21.0 RUN pip3 install torch RUN pip3 install opencv-python RUN pip3 install torchvision RUN pip3 install matplotlib==3.7.3

COPY ./models /root/ros2_ws/src/direct_visual_lidar_calibration/scripts/models COPY ./models /root/ros2_ws/install/direct_visual_lidar_calibration/lib/direct_visual_lidar_calibration/models

it work!!

Davabbb avatar Jun 25 '24 10:06 Davabbb

Hi @koide3, you might want to add the lines above to the dockerfile for setting up the torch environment.

Seekerzero avatar Jun 25 '24 15:06 Seekerzero

@Seekerzero can you please help me with another error?

Davabbb avatar Jun 25 '24 15:06 Davabbb

hi @Davabbb, you might want to raise another issue if the question is not related to this one.

Seekerzero avatar Jun 25 '24 15:06 Seekerzero

Hi guys, If I remember correctly, I avoided including SuperGlue in the docker image because of its license. MagicLeap employs a non-standard strict license, and I was not sure if it's safe to include it. I have read the license again, but I'm still not sure if it allows redistributing the code in a binary docker image. Does anybody have idea about this?

I think it is safe to provide a separate Dockerfile with SuperGlue at least, and I'm going to add something like Dockerfile_with_superglue so that the user can build the image by themselves.

@Seekerzero Thank a lot for your help!, and sorry for making you respond to issues.

koide3 avatar Jun 26 '24 02:06 koide3

I just added Dockerfile_with_superglue. https://github.com/koide3/direct_visual_lidar_calibration/blob/main/docker/humble/Dockerfile_with_superglue

koide3 avatar Jun 26 '24 03:06 koide3

Hi guys, If I remember correctly, I avoided including SuperGlue in the docker image because of its license. MagicLeap employs a non-standard strict license, and I was not sure if it's safe to include it. I have read the license again, but I'm still not sure if it allows redistributing the code in a binary docker image. Does anybody have idea about this?

I think it is safe to provide a separate Dockerfile with SuperGlue at least, and I'm going to add something like Dockerfile_with_superglue so that the user can build the image by themselves.

@Seekerzero Thank a lot for your help!, and sorry for making you respond to issues.

Hi @koide3, you are right, seems like magic leap prohibited any kinds of sublicense from its original copy, even for the research purpose. We want to avoid this risk from it, also the risk of docker distribution. Sorry for not realizing that! We might want to add a way let user link the external path from the superglue folder to the docker file. Or in the future, we can introduce more framework for auto matching.

It is my pleasure to help!

Seekerzero avatar Jun 26 '24 04:06 Seekerzero