OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.92k stars 1.11k forks source link

3.0.3 texturing runs up memory until it fails, only when using triangulation #1585

Open summitbri opened 1 year ago

summitbri commented 1 year ago

How did you install ODM? (Docker, installer, natively, ...)?

Ubuntu 20.04

docker run -ti --detach --rm --tty --name odm_container -v /odm/datasets/project:/datasets/code opendronemap/odm --project-path /datasets \ --auto-boundary \ --orthophoto-resolution 1.5 \ --dsm \ --rerun-from dataset \ --force-gps \ --gps-accuracy 0.03 \ --sfm-algorithm triangulation

What is the problem?

3.0.3 texturing runs through memory and swap until it fails, only fails when using triangulation

What should be the expected behavior? If this is a feature request, please describe in detail the changes you think should be made to the code, citing files and lines where changes should be made, if possible.

Doesn't fail when not using triangulation

How can we reproduce this? What steps did you do to trigger the problem? If this is an issue with processing a dataset, YOU MUST include a copy of your dataset uploaded on Google Drive or Dropbox (otherwise we cannot reproduce this).

Data set and logfile are uploaded here: https://drive.google.com/drive/folders/1b1FaQ9dHYdlNohzoWKTxYTR2gK4SomED?usp=share_link

HeDo88TH commented 1 year ago

It fails regardless of --sfm-algorithm triangulation

Traceback (most recent call last):
  File "C:\ODM\SuperBuild\install\bin\opensfm\bin\\opensfm_main.py", line 25, in <module>
    commands.command_runner(
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\commands\command_runner.py", line 38, in command_runner
    command.run(data, args)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\commands\command.py", line 13, in run
    self.run_impl(data, args)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\commands\detect_features.py", line 13, in run_impl
    detect_features.run_dataset(dataset)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\actions\detect_features.py", line 15, in run_dataset
    features_processing.run_features_processing(data, data.images(), False)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\features_processing.py", line 79, in run_features_processing
    parallel_map(process, arguments, processes, 1)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\context.py", line 59, in parallel_map
    res = Parallel(batch_size=batch_size)(delayed(func)(arg) for arg in args)
  File "C:\ODM\venv\lib\site-packages\joblib\parallel.py", line 1056, in __call__
    self.retrieve()
  File "C:\ODM\venv\lib\site-packages\joblib\parallel.py", line 935, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "multiprocessing\pool.py", line 768, in get
  File "multiprocessing\pool.py", line 125, in worker
  File "C:\ODM\venv\lib\site-packages\joblib\_parallel_backends.py", line 595, in __call__
    return self.func(*args, **kwargs)
  File "C:\ODM\venv\lib\site-packages\joblib\parallel.py", line 262, in __call__
    return [func(*args, **kwargs)
  File "C:\ODM\venv\lib\site-packages\joblib\parallel.py", line 262, in <listcomp>
    return [func(*args, **kwargs)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\features_processing.py", line 146, in process
    read_images(queue, data, images, counter, expected, force)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\features_processing.py", line 163, in read_images
    image_array = data.load_image(image)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\dataset.py", line 109, in load_image
    return self.io_handler.imread(
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\io.py", line 1494, in imread
    return imread_from_fileobject(fb, grayscale, unchanged, anydepth)
  File "C:\ODM\SuperBuild\install\bin\opensfm\opensfm\io.py", line 1248, in imread_from_fileobject
    image = cv2.imdecode(im_buffer, flags)
cv2.error: OpenCV(4.5.0) D:\a\ODM\ODM\SuperBuild\src\opencv\modules\core\src\alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 134184960 bytes in function 'cv::OutOfMemoryError'

I have 64GB RAM and 12GB video card and it says this:

[WARNING] Image size (4096x2730px) would not fit in GPU memory, try lowering --feature-quality. Falling back to CPU

Without parameters it works. I think it's --dsm that causes this abnormal (?) memory usage.