Skip to content

Commit a75619c

Browse files
authored
Update extract_feature_print.py
1 parent 6603959 commit a75619c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

extract_feature_print.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ def readwave(wav_path, normalize=False):
8080
feats = model.final_proj(logits[0])
8181

8282
feats = feats.squeeze(0).float().cpu().numpy()
83-
# feats = np.repeat(feats, 2,0) # 20ms -> 10ms
84-
np.save(out_path, feats, allow_pickle=False)
83+
if(np.isnan(feats).sum()==0):
84+
np.save(out_path, feats, allow_pickle=False)
85+
else:
86+
printt("%s-contains nan"%file)
8587
if (idx % n == 0):printt("now-%s,all-%s,%s,%s"%(len(todo),idx,file,feats.shape))
8688
except:
8789
printt(traceback.format_exc())
88-
printt("all-feature-done")
90+
printt("all-feature-done")

0 commit comments

Comments
 (0)