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

Trying to create "HelloWorld" script for DeepBach #19

Closed
danholle opened this issue May 13, 2017 · 1 comment
Closed

Trying to create "HelloWorld" script for DeepBach #19

danholle opened this issue May 13, 2017 · 1 comment

Comments

@danholle
Copy link

danholle commented May 13, 2017

I'm trying to get DeepBach to minimally work on Ubuntu... sort of like "Hello World" for DeepBach. When I did, I got a score which sounds random... cacophonous, inharmonious, no sense of melody.

I suspect I'm misunderstanding something fundamental... if you could point me in the right direction, I would be most grateful.

Here is what I did on my Ubuntu 16.04 system with Python 3.5.2.

Get musescore
sudo add-apt-repository ppa:mscore-ubuntu/mscore-stable
sudo apt-get update
sudo apt-get install musescore

get Python tools
sudo apt-get install python-pip python-dev
sudo apt-get install python3-pip
pip3 install --upgrade pip

get DeepBach
git clone https://github.com/Ghadjeres/DeepBach
cd DeepBach

Install prerequisites.
h5py is required too; I specified the most recent one.
Note tensorflow 1.x does not work with keras 1.2 so I used TF 0.12.

echo "tensorflow==0.12.0" >> requirements.txt
echo "h5py==2.7.0" >> requirements.txt
sudo pip3 install -r requirements.txt

Fix a glitch: deepBach writes to this dir but dies if it's not already there
mkdir models

Tell music21 about MuseScore
python3

import music21
us=music21.environment.UserSettings()
us['musicxmlPath']='/usr/bin/musescore'
exit()

Now run the first example from README
python3 deepBach.py -l 100

And voila, after a long time it comes back in MuseScore, with some "music"! But it's rapid, chaotic, random stuff. Should it be? How could I fix it?

Thanks

--- Dan

PS I could zip up the MuseScore (.mscz) file and attach it here, if that would help.

@danholle danholle changed the title deepBach runs, but produces gibberish Trying to create "HelloWorld" script for DeepBach May 15, 2017
@Ghadjeres
Copy link
Owner

Thank you for your detailed question.
It seems that your deepbach model is not trained, and thus produces random notes.
There is a link on the main page where you can download a pretrained model. However these models work with the old keras version, I hope it will work on your computer.

I will soon update my code and the models to comply with the Keras 2.0 interface.

In the meantime, if none of the options above work, you can train your own model with

python3 deepbach.py -t num_of_epochs

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