marieai / marie-ai

Integrate AI-powered Document Analysis Pipelines
MIT License
60 stars 5 forks source link

wand contains no images `MagickWand-73384' @ error/magick-image.c/MagickSetImageCompression/10254 #96

Closed gregbugaj closed 10 months ago

gregbugaj commented 11 months ago

Describe the bug Looks like MaginWand fails processing document which causes CUDA error.

ERROR  marie@32 Extract error : wand contains no images `MagickWand-73384' @ error/magick-image.c/MagickSetImageCompression/10254                                [12/04/23 17:59:16]
       Traceback (most recent call last):                                                                                                                                           
         File "/opt/venv/lib/python3.10/site-packages/marie/executor/text/text_extraction_executor.py", line 174, in extract                                                        
           metadata = self.pipeline.execute(                                                                                                                                        
         File "/opt/venv/lib/python3.10/site-packages/marie/pipe/extract_pipeline.py", line 372, in execute                                                                         
           return self.execute_frames_pipeline(                                                                                                                                     
         File "/opt/venv/lib/python3.10/site-packages/marie/pipe/extract_pipeline.py", line 240, in execute_frames_pipeline                                                         
           self.pack_assets(ref_id, ref_type, root_asset_dir, metadata)                                                                                                             
         File "/opt/venv/lib/python3.10/site-packages/marie/pipe/extract_pipeline.py", line 451, in pack_assets                                                                     
           merge_tiff(                                                                                                                                                              
         File "/opt/venv/lib/python3.10/site-packages/marie/utils/tiff_ops.py", line 206, in merge_tiff                                                                             
           composite.save(filename=dst_img_path)                                                                                                                                    
         File "/opt/venv/lib/python3.10/site-packages/wand/image.py", line 10214, in save                                                                                           
           self.raise_exception()                                                                                                                                                   
         File "/opt/venv/lib/python3.10/site-packages/wand/resource.py", line 225, in raise_exception                                                                               
           raise e                                                                                                                                                                  
       wand.exceptions.WandError: wand contains no images `MagickWand-73384' @ error/magick-image.c/MagickSetImageCompression/10254            

Describe how you solve it Related by #95

gregbugaj commented 10 months ago

Wand policy.xml has been updated.

<policymap>
  <!-- <policy domain="system" name="shred" value="2"/> -->
  <!-- <policy domain="system" name="precision" value="6"/> -->
  <!-- <policy domain="system" name="memory-map" value="anonymous"/> -->
  <!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
  <!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
  <policy domain="resource" name="memory" value="32000MiB"/>
  <policy domain="resource" name="map" value="8GiB"/>
  <policy domain="resource" name="width" value="16KP"/>
  <policy domain="resource" name="height" value="16KP"/>
  <!-- <policy domain="resource" name="list-length" value="128"/> -->
  <policy domain="resource" name="area" value="8GiB"/>
  <policy domain="resource" name="disk" value="8GiB"/>