Troubleshooting¶
Every error below is raised by fastabx itself. They are grouped by the moment they happen.
Building a Dataset¶
Most problems appear here, when the item file and the features meet for the first time. Item files describes what fastabx expects from that file.
InvalidItemFileError— “File extension … is not supported”The item file must be a
.item,.csv,.jsonlor.ndjsonfile, and its extension decides how it is parsed. Rename a space-separated table to.item, a comma-separated one to.csv.FileNotFoundError— “N files missing to build the Dataset”None, or not all, of the files named in the
#filecolumn were found underroot. Two usual causes: theextensionargument does not match your files (.ptby default), or the#filevalues are not the paths of the feature files relative toroot, without their extension. A bareutt1will not matchroot/spk1/utt1.pt; the value has to bespk1/utt1. See Matching the features.FeaturesSizeError— “Input features length is not correct for file …”The slice asked for by a row of the item file goes past the end of the features of that file. Usually one of:
The feature frequency is wrong. A file of 10 s at a real 50 Hz has 500 frames; ask for 100 Hz and every token in the second half of the file is out of range.
The model produced one frame too few, which happens with unpadded convolutions when the token sits at the very end of the file. Pad the convolutions, or add a little silence at the end of the audio.
EmptyFeaturesError— “N empty entries found”Some tokens are shorter than a single frame at the given frequency, so their slice is empty. Check the frequency first. If it is right and you do intend to evaluate units that short, remove those rows from the item file. Slicing features explains how the frontiers are computed.
NonFiniteError— “Non-finite values detected in features”A feature file contains a
NaNor an infinity. fastabx refuses it rather than propagating it into the distances, where a singleNaNsilently poisons every triplet it takes part in. Look at the model that produced that file.EmptyDataPointsError— “N empty elements were found in the dataset”Same idea, raised by the accessor: some datapoints span zero frames.
EmptyDatasetError— “The dataset is empty”There is no datapoint at all, so there is no task to build. Usually an item file whose rows were all filtered out upstream, or
labelsof length 0.NonContiguousIndicesError— “The keys of ``indices`` must be exactly the row numbers …”From a hand-built
InMemoryAccessor. Itsindicesmust map every row ofDataset.labels, from0tolen(labels) - 1, to its[start, end[frontiers. A gap would make the missing rows read as empty features rather than raise, so it is rejected up front.FrequencyTypeError— “``frequency`` is getting converted to Decimal”frequencywas afloat. Pass anint(50), or astrfor a non-integer frequency ("12.5"), so that the times stay exact.TimesArrayDimensionError,TimesArrayFrontiersErrorFrom
Dataset.from_item_with_times: the times array of a file is not 1D, or no timestamp of a file falls between theonsetand theoffsetof one of its tokens. In the second case, check that the times are in seconds and cover the whole file.
Building a Task¶
LabelReservedNameError,LabelSuffixErrorA condition column uses a name fastabx needs internally —
index,score,size,is_valid,__cell,__group,__lookup,__pos,__triplet— or ends with_a,_bor_x. Rename the column (speaker_x→x_speaker). See the reserved names.DuplicateConditionsErrorThe same column appears twice across
on,byandacross. Each condition plays exactly one role.UnknownConditionError— “… is not a column of ``Dataset.labels``”A condition names a column the labels do not have, almost always a typo. The message lists every column that is available. Watch out for the ZeroSpeech names in particular: the ON condition of the standard task is
#phone, with the leading#, notphone.EmptyTaskError— “The task has no cell”No triplet satisfies the conditions, so there would be nothing to score. A cell needs two different values of the ON condition among datapoints sharing the same BY values, with at least two instances available for A. The most common cause is a BY condition that is redundant with the ON condition — if every speaker utters a single phone, then
on="#phone", by=["speaker"]can never pair two phones together. Otherwise, the corpus is too small for the conditions asked for.InputTypeErrorA condition is not a string, or a
Subsamplergot a non-integerseed. The subsampler also rejects sizes below 2: a cell needs at least two items to compare.PrecomputedCellsErrorFrom
Task.from_cells. The message says which rule was broken: a missing column amongheader,description,index_a,index_b,index_x; an index column that is not a list of integers; an empty index list; an index outside the dataset; or, for a symmetric task, a row whereindex_aandindex_xdiffer, or one holding fewer than two rows inindex_a— scoring a symmetric cell drops the diagonal, so a single A leaves no triplet at all. See Extending fastabx.InvalidCellErrorA hand-built
Cellwhose A, B and X are not all 3D tensors, do not share a feature dimension, or whose sizes do not match the number of items.
Scoring¶
IdenticalDistanceDimensionErrorThe
"identical"distance compares discrete units, so it needs features of shape(length, 1), one integer per frame. Encode each unit as a single number —Dataset.from_item_and_unitsdoes this for you — or pick a distance defined on vectors.IncompatibleNormalizationErrorYou scored a
Taskwith the"angular"(or"cosine") distance, then scored again with another distance. The firstScoreL2-normalized the dataset in place and appended a singularity column, so the features are no longer in their original space and the second score would be silently wrong. Build a freshDatasetfor the other distance.CollapseErrorEither
levelsandweighted=Truewere both given, or neither was, on cells that have more than the two ON columns left to average. The message lists the columns that are still there: pass them throughlevelsin the order you want them averaged, or ask forweighted=True.EmptyScoreError— “Every cell has a null score”Only with
Constraints, and only when not a single cell kept a valid triplet, so there is nothing left to average. Loosen the constraints, or check that they name the labels you meant (remember the_a,_band_xsuffixes). When only some cells are empty they are skipped by the averages and nothing is raised.InvalidLevelsErrorlevelsis not a list of strings or tuples of strings, repeats a column, or names a column that is not in the scored cells.NoConstraintsErrorThe
Constraintsexpressions do not reference any column ofDataset.labels. Remember the suffixes: a constraint on thespeakerlabel is written withspeaker_a,speaker_bandspeaker_x. See With constraints.PoolingNormalizedErrorpool_datasetwas given aDatasetthat an"angular"(or"cosine")Scorehad already L2-normalized in place. Its features carry an extra singularity column and are no longer in their original space, so pooling them would average that column in and quietly change the measure. Pool first, then score or build a freshDatasetto pool.
ZeroSpeech ABX¶
MissingMaxXAcrossErrorzerospeech_abxwas called withspeaker="across"but nomax_x_across. It has no default because leaving it out is rarely intended: pass5for the original ZeroSpeech behaviour, orNoneexplicitly to disable the subsampling.InvalidSpeakerOrContextErrorspeakermust be"within"or"across", andcontext"within"or"any".
Results that look wrong¶
The score is around 0.5. Chance level. The representations do not separate the categories at all — or the
labels are shuffled with respect to the features. Check that the rows of labels line up with the rows of
features.
The score is suspiciously good. Make sure nothing leaks into the triplets: the same recording appearing as both A and X, for instance. With constraints is the tool for excluding those.
The number is the complement of what you expected. fastabx reports the ABX error rate, so 0.03 means 3% errors, i.e. 97% discriminability.
A score is null. Only happens with Constraints: the cell has no valid triplet left. Those cells
are dropped from the averages rather than counted as zero.
Scores differ from Libri-Light or ZeroSpeech 2021. Expected, and explained in Coming from other libraries: their
slicing drops one frame per token. Set FASTABX_WITH_LIBRILIGHT_BUG=1 to reproduce the old numbers.
Out of memory¶
Both the features and the intermediate distances live on the same device. See Performance and memory for what is allocated, and for the arguments and environment variables that bound it.
InvalidEnvironmentVariableErrorOne of the
FASTABX_*tuning variables of Performance tuning is set to something that is not a positive integer. The message names the variable; unset it to go back to the default.