Hello! I recently updated vak to v0.8.0 and TweetyNet to v0.9.0 and have encountered a new error (that I did not get with my previous installs) at the very last step of using the predict method of vak.
Here is the full traceback:
Traceback (most recent call last):
File "C:\Users\Nerissa\anaconda3\envs\vak-env4\Scripts\vak-script.py", line 9, in <module>
sys.exit(main())
File "C:\Users\Nerissa\anaconda3\envs\vak-env4\lib\site-packages\vak\__main__.py", line 48, in main
cli.cli(command=args.command, config_file=args.configfile)
File "C:\Users\Nerissa\anaconda3\envs\vak-env4\lib\site-packages\vak\cli\cli.py", line 49, in cli
COMMAND_FUNCTION_MAP[command](toml_path=config_file)
File "C:\Users\Nerissa\anaconda3\envs\vak-env4\lib\site-packages\vak\cli\cli.py", line 18, in predict
File "C:\Users\Nerissa\anaconda3\envs\vak-env4\lib\site-packages\vak\cli\predict.py", line 50, in predict
core.predict(
File "C:\Users\Nerissa\anaconda3\envs\vak-env4\lib\site-packages\vak\core\predict.py", line 244, in predict
seq = crowsetta.Sequence.from_keyword(
File "C:\Users\Nerissa\anaconda3\envs\vak-env4\lib\site-packages\crowsetta\sequence.py", line 382, in from_keyword
labels) = cls._validate_onsets_offsets_labels(onsets_s,
File "C:\Users\Nerissa\anaconda3\envs\vak-env4\lib\site-packages\crowsetta\sequence.py", line 224, in _validate_onsets_offsets_labels
raise ValueError('must provide either onset_inds and offset_inds, or '
ValueError: must provide either onset_inds and offset_inds, or onsets_s and offsets_s
I did a little bit of digging and determined that audio segments without any calls are tripping up the crowsetta conversion process. Specifically, at line 239 of the vak predict.py file, there is a check for empty segments that is going awry because labels is turning up an empty list rather than a None
object.
if labels is None and onsets_s is None and offsets_s is None:
# handle the case when all time bins are predicted to be unlabeled
# see https://github.com/NickleDave/vak/issues/383
continue
seq = crowsetta.Sequence.from_keyword(
labels=labels, onsets_s=onsets_s, offsets_s=offsets_s
)
Inspecting the variables at this step shows that onset_s
and offset_s
are None
as expected, but not labels
.
(Pdb) print(len(labels))
0
(Pdb) print(len(onsets_s))
*** TypeError: object of type 'NoneType' has no len()
(Pdb) print(len(offsets_s))
*** TypeError: object of type 'NoneType' has no len()
Not sure how I can adjust my data to avoid this error—what am I missing?
Thanks!