File size: 802 Bytes
b67cafe a097882 b67cafe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from lhotse import CutSet, load_manifest_lazy
import torch
manifest_path = "data/fbank/cuts_debug.jsonl.gz" # many inf values
manifest_path = "data/fbank_voice_assistant_cosy2_hdf5/cuts_debug_h5py.jsonl.gz" # few inf values
cuts_manifest = load_manifest_lazy(manifest_path)
for i, cut in enumerate(cuts_manifest):
feats = cut.load_features()
feats = torch.from_numpy(feats)
if torch.isnan(feats).any() or torch.isinf(feats).any():
print("cut.load_features() nan or inf, index: ", i)
nan_indices = torch.where(torch.isnan(feats))
inf_indices = torch.where(torch.isinf(feats))
print(feats[nan_indices])
print(feats[inf_indices])
print("fbank nan or inf")
print(f"nan_indices: {nan_indices}, inf_indices: {inf_indices}")
exit()
|