nerfstudio-project / nerfstudio

A collaboration friendly studio for NeRFs
https://docs.nerf.studio
Apache License 2.0
9.19k stars 1.23k forks source link

Cannot install colmap with vcpkg on Windows #2260

Open gabrielemucho opened 1 year ago

gabrielemucho commented 1 year ago

My nerfstudio installation works well with your in-built dataset, e.g. it trains and renders 3D model, but it does not work with custom dataset, and the colmap installation keeps failing though I've tried all code variants from github.com.microsoft/vcpkg. Pls see the attached error message. Any suggestions?

failure to install vcpgk 2023-07-23 131433
maturk commented 1 year ago

Looks like it is failing to build Colmap with vcpkg on your machine. I am not sure why, but you could try an alternative installation. From colmap's github releases you can download the latest .zip (COLMAP-3.8-windows-cuda.zip) file. Make sure you add Colmap to your system environment path and restart your cmd/terminal (open and close it again). To add colmap to path you can check some other links like:

https://peterfalkingham.com/2018/04/01/colmap-openmvs-scripts-updated/#:~:text=Type%20“edit%20the%20system%20environment,Now%20the%20script%20should%20work. or https://github.com/colmap/colmap/issues/1539

gabrielemucho commented 1 year ago

Thank you for your advice! Will try these options. From your tutorial it is not clear thought whether colma should be installed at the root base (I'm going with Anaconda) or at the nerfstudio level (see the image).

which level

gabrielemucho commented 1 year ago

Dear Matias,

Thank you for all your answers so far. I've tried to install and run Nerf Studio on two local machines and once on Google Colab, and there is always something wrong with it one way or another that I cannot fix on my own.

I'm a senior lecturer at King's College London and am leading a project that maps wooden Ukrainian churches. Part of our project is to start experimenting with 3D modelling based on hybrid and disparate image and video data given the circumstances that make it impossible to do traditional photogrammetry.

I wonder if you could help us set up the studio to get us going.

Best wishes, Gabriele Salciute Civiliene

On Sun, 23 Jul 2023, 19:42 Matias Turkulainen, @.***> wrote:

Looks like it is failing to build Colmap with vcpkg on your machine. I am not sure why, but you could try an alternative installation. From colmap's github releases you can download the latest .zip ( COLMAP-3.8-windows-cuda.zip https://github.com/colmap/colmap/releases/download/3.8/COLMAP-3.8-windows-cuda.zip) file. Make sure you add Colmap to your system environment path and restart your cmd/terminal (open and close it again). To add colmap to path you can check some other links like:

https://peterfalkingham.com/2018/04/01/colmap-openmvs-scripts-updated/#:~:text=Type%20“edit%20the%20system%20environment,Now%20the%20script%20should%20work https://peterfalkingham.com/2018/04/01/colmap-openmvs-scripts-updated/#:~:text=Type%20%E2%80%9Cedit%20the%20system%20environment,Now%20the%20script%20should%20work . or colmap/colmap#1539 https://github.com/colmap/colmap/issues/1539

— Reply to this email directly, view it on GitHub https://github.com/nerfstudio-project/nerfstudio/issues/2260#issuecomment-1646927909, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEUKHLIDG7BFNRCTOHBWS4LXRVWANANCNFSM6AAAAAA2UVMCBM . You are receiving this because you authored the thread.Message ID: @.***>

maturk commented 1 year ago

Sorry for the delay, colmap should be installed at the system level so at the base environment. Better yet, if you deactivate all environments (by typing 'conda deactivate') you should be able to run colmap by simply tying 'colmap' into the terminal/cmd. This is the ideal setup, if you are able to run 'colmap' from the cmd/terminal directly then it has been installed correctly and also nerfstudio will be able to find it in its python scripts.

I assume you are on windows, and it is indeed a bit trickier to install colmap on windows from my experience. Are you running into any errors trying to install colmap directly from https://demuc.de/colmap/ ? At the bottom of this page you should try install the windows zip file and extract it to a convenient place on your system. Then you have to add the path to the /COLMAP-3.8-windows-cuda/bin path to your system variables path on Windows.

image

To test that your system is able to find colmap after updating the PATH variable, restart your cmd/terminal and type 'colmap' into the terminal and it should pop up with some information and help things regarding colmap.

gabrielemucho commented 1 year ago

Thank you for a detailed explanation. I've downloaded colmap from where you indicated, installed it and then added to the PATH variable, but when I try to run it in cmd, the following problem/s are flagged as in the screenshots attached. I've tried it on two machines, and the result is the same.

colmap issues colmap issues2

maturk commented 1 year ago

Did you restart the terminal as well after installing? If that does not work, I am not sure what the problem is. I am not a windows user and Colmap can be a pain installing on windows. Could you please also try installing an older version of Colmap, so not the newest release.

OlausRoe commented 6 months ago

Thank you for a detailed explanation. I've downloaded colmap from where you indicated, installed it and then added to the PATH variable, but when I try to run it in cmd, the following problem/s are flagged as in the screenshots attached. I've tried it on two machines, and the result is the same.

colmap issues colmap issues2

I found I had to add the path to the root of colmap to get this to work. So that the system runs COLMAP.bat notthe exe in the bin folder. (COLMAP-3.9.1-windows-cuda)

yanhanruan commented 6 months ago

after extracting the folder from zip, I add the "C:\Users\WIN\Desktop\COLMAP-3.9.1-windows-cuda\bin" and "C:\Users\WIN\Desktop\COLMAP-3.9.1-windows-cuda\lib"(example, you should change to your own path), these two paths to environment path in window10 setting, so that the CMD or PowerShell can run "colmap", but anaconda(base) may get an input point error, but when i activated nerfstudio in anaconda and type 'colmap' into the terminal and it pop up with some information successfully

MoisesFelipe commented 5 months ago

I had the same initial issue and after adding the colmap path for both lib and bin in the environment variable I still had to copy the colmap.exe file from bin to lib. After that I could smoothly run colmap in my anaconda environment