Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: could not broadcast input array from shape #89

Open
gregbugaj opened this issue Oct 24, 2023 · 0 comments
Open

ValueError: could not broadcast input array from shape #89

gregbugaj opened this issue Oct 24, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gregbugaj
Copy link
Collaborator

gregbugaj commented Oct 24, 2023

Negative region coordinates cause broadcast error.



ERROR  06538401-2115-7838-8000-234c29f83b38 : VotingOcrEngine@1809103 Extract error                                                                                                                                
       Traceback (most recent call last):                                                                                                                                                                          
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 128, in process_single                                                                                                             
           results = self.__process_extract_regions(                                                                                                                                                               
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 340, in __process_extract_regions                                                                                                  
           raise ex                                                                                                                                                                                                
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 284, in __process_extract_regions                                                                                                  
           overlay[padding : h + padding, padding : w + padding] = img                                                                                                                                             
       ValueError: could not broadcast input array from shape (30,0,3) into shape (30,254,3)                                                                                                                       
Traceback (most recent call last):
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/voting_ocr_engine.py", line 93, in extract
    results = self.process_single(
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 141, in process_single
    raise error
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 128, in process_single
    results = self.__process_extract_regions(
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 340, in __process_extract_regions
    raise ex
  File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/ocr_engine.py", line 284, in __process_extract_regions
    overlay[padding : h + padding, padding : w + padding] = img
ValueError: could not broadcast input array from shape (30,0,3) into shape (30,254,3)
INFO   06538401-2115-7838-8000-234c29f83b38 : VotingOcrEngine@1809103 Voting evaluator                                                                                                                             
WARNI… 06538401-2115-7838-8000-234c29f83b38 : VotingOcrEngine@1809103 No results to evaluate                                                                                                                       
ERROR  06538401-2115-7838-8000-234c29f83b38 : TextExtractionExecutor@1809103 Extract error : 'NoneType' object does not support item assignment                                                                    
       Traceback (most recent call last):                                                                                                                                                                          
         File "/home/gbugaj/dev/marieai/marie-ai/marie/executor/text/text_extraction_executor.py", line 168, in extract                                                                                            
           metadata = self.pipeline.execute(                                                                                                                                                                       
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/extract_pipeline.py", line 648, in execute                                                                                                              
           return self.execute_regions_pipeline(                                                                                                                                                                   
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/extract_pipeline.py", line 567, in execute_regions_pipeline                                                                                             
           results = self.ocr_frames(                                                                                                                                                                              
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/extract_pipeline.py", line 449, in ocr_frames                                                                                                           
           results = engine.extract(frames, ps_mode, coord_format, regions)                                                                                                                                        
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/voting_ocr_engine.py", line 111, in extract                                                                                                             
           return self.voting_evaluator(aggregated_results, default_results, regions)                                                                                                                              
         File "/home/gbugaj/dev/marieai/marie-ai/marie/ocr/voting_ocr_engine.py", line 268, in voting_evaluator                                                                                                    
           output_results["regions"] = []                                                                                                                                                                          
       TypeError: 'NoneType' object does not support item assignment                                                                                                                                               
ERROR              : extract_t/rep-0@1809103 ValueError('Unexpected type')                                                                                                                      [10/24/23 17:07:14]
        add "--quiet-error" to suppress the exception details                                                                                                                                                      
       Traceback (most recent call last):                                                                                                                                                                          
         File "/home/gbugaj/dev/marieai/marie-ai/marie/serve/runtimes/worker/request_handling.py", line 1087, in process_data                                                                                      
           result = await self.handle(                                                                                                                                                                             
         File "/home/gbugaj/dev/marieai/marie-ai/marie/serve/runtimes/worker/request_handling.py", line 717, in handle                                                                                             
           _ = self._set_result(requests, return_data, docs)                                                                                                                                                       
         File "/home/gbugaj/dev/marieai/marie-ai/marie/serve/runtimes/worker/request_handling.py", line 556, in _set_result                                                                                        
           requests[0].parameters = params                                                                                                                                                                         
         File "/home/gbugaj/dev/marieai/marie-ai/marie/types/request/data.py", line 316, in parameters                                                                                                             
           self.proto_wo_data.parameters.update(parameters)                                                                                                                                                        
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 820, in update                                                             
           _SetStructValue(self.fields[key], value)                                                                                                                                                                
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 746, in _SetStructValue                                                    
           struct_value.struct_value.update(value)                                                                                                                                                                 
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 820, in update                                                             
           _SetStructValue(self.fields[key], value)                                                                                                                                                                
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 746, in _SetStructValue                                                    
           struct_value.struct_value.update(value)                                                                                                                                                                 
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 820, in update                                                             
           _SetStructValue(self.fields[key], value)                                                                                                                                                                
         File "/home/gbugaj/environments/pytorch2-3.10/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 751, in _SetStructValue                                                    
           raise ValueError('Unexpected type')                                                                                                                                                                     
       ValueError: Unexpected type   

@gregbugaj gregbugaj added the bug Something isn't working label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant