From a75619c453fe5fdca923b15c61430e648b74193e Mon Sep 17 00:00:00 2001 From: liujing04 <129054828+liujing04@users.noreply.github.com> Date: Sun, 9 Apr 2023 15:31:38 +0000 Subject: [PATCH] Update extract_feature_print.py --- extract_feature_print.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extract_feature_print.py b/extract_feature_print.py index 2e5eeb3..51db7fe 100644 --- a/extract_feature_print.py +++ b/extract_feature_print.py @@ -80,9 +80,11 @@ else: feats = model.final_proj(logits[0]) feats = feats.squeeze(0).float().cpu().numpy() - # feats = np.repeat(feats, 2,0) # 20ms -> 10ms - np.save(out_path, feats, allow_pickle=False) + if(np.isnan(feats).sum()==0): + np.save(out_path, feats, allow_pickle=False) + else: + printt("%s-contains nan"%file) if (idx % n == 0):printt("now-%s,all-%s,%s,%s"%(len(todo),idx,file,feats.shape)) except: printt(traceback.format_exc()) - printt("all-feature-done") \ No newline at end of file + printt("all-feature-done")