HatefulMemesChallenge icon indicating copy to clipboard operation
HatefulMemesChallenge copied to clipboard

Failed to run annotation processing.

Open nikhilbchilwant opened this issue 3 years ago • 0 comments

I tried to run bash run_anno_preocessing.sh but it failed with below error below. It succeeded for some images but fails for this.

----------------------------------------------------------------------------------------------------                                                                                [132/1511]
2021-05-13 14:50:02.882 | INFO     | __main__:insert_anno_jsonl:840 - 87130.png                
ocr_to_img_box:  [0]                                                                           
2021-05-13 14:50:02.882 | ERROR    | __main__:<module>:901 - An error has been caught in function '<module>', process 'MainProcess' (7719), thread 'MainThread' (140125357684480):
Traceback (most recent call last):                                                             
                                                                                               
> File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 901, in <module>
    fire.Fire({                                                                                
    │    └ <function Fire at 0x7f7178bee430>                                                                                                                                                  
    └ <module 'fire' from '/nethome/nchilwant/miniconda3/envs/himario/lib/python3.8/site-packages/fire/__init__.py'>
                                                                                                                                                                                              
  File "/nethome/nchilwant/miniconda3/envs/himario/lib/python3.8/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)                                                                                                                 
                      │     │          │     │                 │        └ 'web_enetity.py'     
                      │     │          │     │                 └ {}                                                                                                                           
                      │     │          │     └ Namespace(completion=None, help=False, interactive=False, separator='-', trace=False, verbose=False)
                      │     │          └ ['insert_anno_jsonl', '/data/users/nchilwant/projects/HatefulMemesChallenge/data/summary_entity_cleaned.pickle', '/data/users...
                      │     └ {'detect_web': <function detect_web at 0x7f70a3cea940>, 'detect_image': <function detect_image at 0x7f70a3ceaaf0>, 'detect_da...
                      └ <function _Fire at 0x7f7178232160>                                                                                                                                    
  File "/nethome/nchilwant/miniconda3/envs/himario/lib/python3.8/site-packages/fire/core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(                                                                                                                                          
    │                           └ <function _CallAndUpdateTrace at 0x7f7178232280>             
    └ <function insert_anno_jsonl at 0x7f70a39c0ca0>                                                                                                                                          
  File "/nethome/nchilwant/miniconda3/envs/himario/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)                                                         
                │   │          └ {}                                                            
                │   └ ['/data/users/nchilwant/projects/HatefulMemesChallenge/data/summary_entity_cleaned.pickle', '/data/users/nchilwant/projects/H...
                └ <function insert_anno_jsonl at 0x7f70a39c0ca0>                                                                                                                              
                                                                                               
  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 841, in insert_anno_jsonl
    char_to_img_box = find_appearence(anno['text'], ocr_boxes, image_boxes)                    
                      │               │             │          └ [[0, 0, 790, 530.7451782226562, 0.9998193383216858], [0, 530.7451782226562, 790, 800, 0.9999945163726807]]
                      │               │             └ [[[3, 7, 775, 49], 'Mimally Minding @hbe righu @utorial vou meed   iidiam accedt', 0.03742895015062143]]
                      │               └ {'id': 87130, 'img': 'img/87130.png', 'label': 1, 'text': 'finally finding the right tutorial you need indian accent'}
                      └ <function insert_anno_jsonl.<locals>.find_appearence at 0x7f709cd7bb80> 
                                                                                               
  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 749, in find_appearence
    match_slice, match_score = get_best_match(txt, meme_txt, step=2, flex=4)                   
                               │              │    └ 'finally finding the right tutorial you need indian accent'
                               │              └ 'Mimally Minding @hbe righu @utorial vou meed   iidiam accedt'
                               └ <function get_best_match at 0x7f7178d55160>                   

  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 217, in get_best_match
    pos = index_max(match_values) * step
          │         │               └ 2
          │         └ []
          └ <function get_best_match.<locals>.index_max at 0x7f70514df0d0>                     

  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 163, in index_max
    return max(range(len(v)), key=v.__getitem__)                                               
                         │        │ └ <method '__getitem__' of 'list' objects>                 
                         │        └ []
                         └ []

ValueError: max() arg is an empty sequence
Traceback (most recent call last):
  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 901, in <module>
    fire.Fire({                                
  File "/nethome/nchilwant/miniconda3/envs/himario/lib/python3.8/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)                  
  File "/nethome/nchilwant/miniconda3/envs/himario/lib/python3.8/site-packages/fire/core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(                                           
  File "/nethome/nchilwant/miniconda3/envs/himario/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 841, in insert_anno_jsonl
    char_to_img_box = find_appearence(anno['text'], ocr_boxes, image_boxes)                    
  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 749, in find_appearence
    match_slice, match_score = get_best_match(txt, meme_txt, step=2, flex=4)                   
  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 217, in get_best_match
    pos = index_max(match_values) * step
  File "/data/users/nchilwant/projects/HatefulMemesChallenge/data_utils/gcp/web_enetity.py", line 163, in index_max
    return max(range(len(v)), key=v.__getitem__)                                               
ValueError: max() arg is an empty sequence            

nikhilbchilwant avatar May 13 '21 17:05 nikhilbchilwant