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

num_classes.txt not found #1

Open
lu3do opened this issue May 11, 2018 · 6 comments
Open

num_classes.txt not found #1

lu3do opened this issue May 11, 2018 · 6 comments

Comments

@lu3do
Copy link

lu3do commented May 11, 2018

I'm trying to run this (using docker) and ran into some small issues but was able to fix those myself.
for example tables module was missing, so I added that to the Dockerfile (will submit a PR for it later)
RUN pip --no-cache-dir install sqlalchemy pyyaml spotipy tables

But now i'm running into the next issue which is the missing num_classes.txt

I wanted to use the pretrained model, so copied that to the data/out but when running the classify it throws this error:

File "/notebooks/genres/train.py", line 26, in <module>
    with open('%s/%s' % (out_dir, 'num_classes.txt')) as f:
IOError: [Errno 2] No such file or directory: 'data/out/num_classes.txt'

Not sure what that file should contain? or how it can be generated.

@lu3do
Copy link
Author

lu3do commented May 11, 2018

same goes for the num_features.txt file btw,

I guess it needs the configuration values for tensorflow, but want to know which values you've used.

@dpraul
Copy link
Owner

dpraul commented May 11, 2018

Oh wow, didn't anticipate that this repo would ever see any interest, but glad to help as much as I can. It's been a while since I've touched this project (and last I did, it was rushed, so there are definitely some poor design choices in here -- bear with me).

num_classes.txt and num_features.txt are generated by the graph step (for some reason), seen here: https://github.com/dpraul/genres-are-cool/blob/master/genres/graph.py#L95. Each file is just a single integer to help the neural network. Classes = genres, features = Spotify sound features. Certainly not the best way to do it, but hindsight.

I believe there are 15 genres, so num_classes.txt should just hold the number 15. There are 13 Spotify features, so num_features.txt should hold the number 13.

Let me know if that helps you along! Sadly, I just last week deleted all my local files for this repo, or else I'd be able to hand off more to you.

@dpraul
Copy link
Owner

dpraul commented May 11, 2018

In regards to your Docker issue, I image that stems from my poor foresight in not locking the Dockerfile to a particular version of Tensorflow, which has had many updates since I created this repo. Checking the GCR for Tensorflow, I imagine I was using version 0.9.0, linked here: https://console.cloud.google.com/gcr/images/tensorflow/GLOBAL/tensorflow@sha256:1e4ccc1a590cd52c6bfda6ee9f6ae7c2da8ef80e67e744532d1d5010cd92e9b2/details/info. You might try modifying the Dockerfile to use that version

@dpraul
Copy link
Owner

dpraul commented May 11, 2018

Ah, just kidding! I have a link to the docs for Tensorflow 0.10.0 in the README - use that version.

@lu3do
Copy link
Author

lu3do commented May 11, 2018

Ok will try with that specific version.

Yea it also amazes me that this repo doesn't have a lot of activity.
I'm trying out ML for the first time, I want to build something to match a song to playlist(s) based on a song's audio features against the audio features of all songs already in a playlists. So I think your repo is a good starting point.

@dpraul
Copy link
Owner

dpraul commented May 11, 2018

Sounds fun! Best of luck. This repo was my first stab at ML, so do keep in mind that I'm sure there are amateurish and incorrect parts throughout, but I hope it serves useful as a reference

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

No branches or pull requests

2 participants