Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YamlOutput exports invalid JSON #689

Closed
vladinator1000 opened this issue Mar 8, 2018 · 3 comments
Closed

YamlOutput exports invalid JSON #689

vladinator1000 opened this issue Mar 8, 2018 · 3 comments
Labels

Comments

@vladinator1000
Copy link

vladinator1000 commented Mar 8, 2018

Hi guys, I noticed that in Python when exporting a .json file like this:

aggregated_pool = PoolAggregator(defaultStats = stats)(current_extractor)
YamlOutput(filename = someName, format = 'json')(aggregated_pool)

When there is a nan or inf value, the exporter doesn't put it in a string, which triggers an exception when trying to import the .json file.

@dbogdanov
Copy link
Member

How does the resulting Json file look like?

According to JSON specification, there is no Infinity or NaN values, and, in the first place, there shouldn't be any inf or nan values produced by Essentia's algorithms. Can you provide an example script and audio input to reproduce those values?

@dbogdanov dbogdanov added the bug label Mar 8, 2018
@vladinator1000
Copy link
Author

Sure thing, this repo should reproduce it: https://github.com/savovs/essentia-json-bug

I'm using the UrbanSound dataset. For some reason I didn't get the nan value when I reran the extraction so the example only has the inf case.

@dbogdanov
Copy link
Member

Thank you for reporting, this should be fixed now. On a side note, note that Extractor algorithm is somewhat outdated (#691), and it can make sense using MusicExtractor or FreesoundExtractor instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants