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

Update extractor.py #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Arjannikov
Copy link

There's a small bug, not sure exactly where. I describe the issue and proposed solution below.

In my program I call extractor() to get features and then top_tag() to get tags in a loop (once per song file). On second iteration of the loop, top_tag() fails on line 75, which contains the statement: print(' - ' + tags[tag_index]). The error is that a string cannot be concatenated with a list(). The cause being that somehow the variable containing the list of tags in configuration.py (either MTT_LABELS or MSD_LABELS depending on parameters) gets appended a list of top tags computed by top_tag().

This issue does not happen if I run top_tag() in a loop alone or extractor() alone, but when I run extractor() followed by top_tag(), on each iteration of the loop the MTT_LABELS or MSD_LABELS gets appended a list of topN_tags.

The easy/shortcut solution is to take a copy of that list (in configuration.py) instead of a pointer to it.

There's a small bug, not sure exactly where. I describe the issue and proposed solution below.

In my program I call extractor() to get features and then top_tag() to get tags in a loop (once per song file). On second iteration of the loop, top_tag() fails on line 75, which contains the statement: print(' - ' + tags[tag_index]). The error is that a string cannot be concatenated with a list(). The cause being that somehow the variable containing the list of tags in configuration.py (either MTT_LABELS or MSD_LABELS depending on parameters) gets appended a list of top tags computed by top_tag(). 

This issue does not happen if I run top_tag() in a loop alone or extractor() alone, but when I run extractor() followed by top_tag(), on each iteration of the loop the MTT_LABELS or MSD_LABELS gets appended a list of topN_tags. 

The easy/shortcut solution is to take a copy of that list (in configuration.py) instead of a pointer to it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant