Forum

Author Topic: Can't uncompress tile when splitting into chunks  (Read 392 times)

GalDa

  • Newbie
  • *
  • Posts: 2
    • View Profile
Can't uncompress tile when splitting into chunks
« on: May 09, 2025, 10:07:55 AM »
Also posted here: https://github.com/agisoft-llc/metashape-scripts/issues/119

Hi there,

I'm working on generating a very large tiled model composed of thousands of images. To manage this, I'm following the logic used in the
Code: [Select]
split_in_chunks_dialog.py script, with an additional step to divide the tiled model generation as well. This is necessary because attempting to build a tiled model from a single, large merged model consistently results in a "bad allocation" error due to insufficient memory.

To handle this, I’m building one tiled model per chunk. I use the operand_chunk to merge previously built valid tiled models into the current one.

This approach generally works, but occasionally I encounter the error: "Can't uncompress tile", and the older tiled models fail to merge into the current one, even though they were built successfully. It doesn't appear to be a performance issue, and I'm unsure what’s causing the failure.

Below is the relevant portion of the code that's failing:


Code: [Select]
if operand_chunk.tiled_model:  # If the previous chunk has a tiled model to merge
    new_chunk.buildTiledModel(
        tile_size=256,
        pixel_size=GSD,
        source_data=Metashape.DataSource.ModelData,
        face_count=20000,
        transfer_texture=True,
        ghosting_filter=False,
        merge=True,
        operand_chunk=operand_chunk.key,
        progress=progress_print)
else:  # This is the first tiled model to be created
    new_chunk.buildTiledModel(
        tile_size=256,
        pixel_size=GSD,
        source_data=Metashape.DataSource.ModelData,
        face_count=20000,
        transfer_texture=True,
        ghosting_filter=False,
        progress=progress_print)

if new_chunk.tiled_model:  # Check if the tiled model was created successfully
    valid_index = index  # Update the valid index to the latest chunk with a tiled model
    operand_chunk = doc.chunks[valid_index]  # Update the operand_chunk


Note: GSD is calculated earlier and is approximately 0.03.

Do you have any insights into what might be causing the "Can't uncompress tile" error? I am sure it get's the right
Code: [Select]
operand_chunk.key.
a partial log showing the error for reference is attached.


Environment:
- Metashape Python SDK: 2.2.0
- CPU: Intel® Core™ i9-14900
- GPU: NVIDIA GeForce RTX 4070 (not overclocked)
-  RAM: 32 GB
-  OS: Windows 11 (23H2)


Thanks in advance for your help!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15465
    • View Profile
Re: Can't uncompress tile when splitting into chunks
« Reply #1 on: May 20, 2025, 02:58:56 PM »
Hello GalDa,

Can you please confirm, that the issue is fixed in the latest 2.2.1 version?
Best regards,
Alexey Pasumansky,
Agisoft LLC

GalDa

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Can't uncompress tile when splitting into chunks
« Reply #2 on: May 21, 2025, 02:31:04 PM »
Yes, fixed in 2.2.1