Giter Site home page Giter Site logo

BUG: predict empty file handling about vak HOT 4 CLOSED

nhoglen avatar nhoglen commented on June 25, 2024
BUG: predict empty file handling

from vak.

Comments (4)

NickleDave avatar NickleDave commented on June 25, 2024

Sorry you had this issue @nhoglen and thank you for this very thorough bug report.

I'll know for sure when I test with the data but my hunch is you have correctly identified the issue; we do not correctly handle the case where there are no predicted segments because we don't look for the empty list

This was supposed to be fixed by #394 but clearly it wasn't!

Could you please share the data some other way? I wasn't able to open the sharepoint link. Will ask by email too but wanted to reply here (and thank you profusely for making this easy for me to fix 😼 😁 )

edit: Box link you sent worked, nvm!

second edit: just to cross-link, this was originally posted on the forum: https://forum.vocalpy.org/t/error-in-last-step-of-generating-predictions/54

from vak.

NickleDave avatar NickleDave commented on June 25, 2024

πŸ€” I'm not able to replicate this bug -- vak predict runs fine for me on Linux using the files you provided.

Could you please reply with the following files attached?

  • the .toml configuration file you're using
  • the output of running the following command in your conda environment: conda env export > environment.yml
  • as well as conda list --explicit > spec-file.txt (also in the conda environment you are using when you get this bug)

I'm attaching the .toml file I used as well as the csv of annotations that was produced, in a .tar

predict-results.tar.gz

fwiw I have the same versions of vak, tweetynet, and crowsetta installed. I can try making an env on Windows with conda files just in case for some reason the platform is the source of the issue.

Thank you! πŸ™

from vak.

nhoglen avatar nhoglen commented on June 25, 2024

Oops, sorry I missed this -- I'm not used to looking out for things on GitHub.

I have found that getting the environment set up right on Windows takes some finagling, so I would not be surprised if there are weird version issues baked in there.

The attached zip has the listed files. environment-etc.zip

I'm happy to keep poking at this and will keep a closer eye on GitHub/figure out how to get it to send more notifications.

from vak.

NickleDave avatar NickleDave commented on June 25, 2024

Thank you @nhoglen! That helped.
It was an option in the TOML config file that I was missing, the min_segment_dur.
Once I added that to the config I had, I was able to replicate your error.

I now also get the same exception that you first reported on the forum:

Traceback (most recent call last):
  File "/home/pimienta/miniconda3/envs/vak8-env/bin/vak", line 10, in <module>
    sys.exit(main())
  File "/home/pimienta/miniconda3/envs/vak8-env/lib/python3.8/site-packages/vak/__main__.py", line 48, in main
    cli.cli(command=args.command, config_file=args.configfile)
  File "/home/pimienta/miniconda3/envs/vak8-env/lib/python3.8/site-packages/vak/cli/cli.py", line 49, in cli
    COMMAND_FUNCTION_MAP[command](toml_path=config_file)
  File "/home/pimienta/miniconda3/envs/vak8-env/lib/python3.8/site-packages/vak/cli/cli.py", line 18, in predict
    predict(toml_path=toml_path)
  File "/home/pimienta/miniconda3/envs/vak8-env/lib/python3.8/site-packages/vak/cli/predict.py", line 50, in predict
    core.predict(
  File "/home/pimienta/miniconda3/envs/vak8-env/lib/python3.8/site-packages/vak/core/predict.py", line 243, in predict
    seq = crowsetta.Sequence.from_keyword(
  File "/home/pimienta/miniconda3/envs/vak8-env/lib/python3.8/site-packages/crowsetta/sequence.py", line 382, in from_keyword
    labels) = cls._validate_onsets_offsets_labels(onsets_s,
  File "/home/pimienta/miniconda3/envs/vak8-env/lib/python3.8/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
(vak8-env)  ✘ pimienta@pop-os ξ‚° ~/Documents/data/vocal/bug-reportξ‚°

It does look like this is in fact a bug I introduced when I added a new feature here:
8c6aee1
where for some reason that's not clear to me now I changed this function to return an empty string when there were no predicted segments after post-processing (e.g. with a min. segment dur):


whereas the same condition would have caused the previous version of this function would have returned all Nones:
return None, None, None

Not sure if changing it back will break any other changes I made--will find out when I test--but my plan is to change it back for now and release a bugfix version.

from vak.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.