File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -514,13 +514,15 @@ def precompute_image_embeddings(
514514 ("halo" , halo if halo is None else list (halo )),
515515 ("model_type" , predictor .model_type )
516516 ]
517- for key , val in key_vals :
518- if "input_size" in f .attrs : # we have computed the embeddings already
519- # key signature does not match or is not in the file
517+ if "input_size" in f .attrs : # we have computed the embeddings already and perform checks
518+ for key , val in key_vals :
519+ if val is None :
520+ continue
521+ # check whether the key signature does not match or is not in the file
520522 if key not in f .attrs or f .attrs [key ] != val :
521523 warnings .warn (
522524 f"Embeddings file { save_path } is invalid due to unmatching { key } : "
523- f"{ f .attrs [ key ] } != { val } .Please recompute embeddings in a new file."
525+ f"{ f .attrs . get ( key ) } != { val } .Please recompute embeddings in a new file."
524526 )
525527 if wrong_file_callback is not None :
526528 save_path = wrong_file_callback (save_path )
You can’t perform that action at this time.
0 commit comments