Sign inSign up

previtus/demo-lstm-music-gen-cpu

By previtus

•Updated over 6 years ago

Image
0

3.3K

previtus/demo-lstm-music-gen-cpu repository overview

⁠[CPU version] Docker demo for LSTM music generator - https://github.com/previtus/music_gen_interaction_RTML⁠

The CPU version of the docker image for the music generating LSTM model project. In my experience it works fine (if it's too slow on your machine set a larger "length" on the gui panel) when generating music from pre-trained model, however for training a new model I would recommend using the GPU version (for speed). Having a CPU only version might also be handy if you want to run something else one you GPU (however ensure that you have enough RAM for both).

GPU version: check https://hub.docker.com/repository/docker/previtus/demo-lstm-music-gen⁠

Note: the commands for CPU and GPU versions are more or less very similar, the CPU version doesnt need "--gpus all"

⁠0 Setup

Please install docker

⁠1 Demo with the default LSTM model:

xhost +SI:localuser:root

#sudo docker run -it --rm --privileged=true --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --env="QT_X11_NO_MITSHM=1" -v $(pwd)/data/:/home/music_gen_interaction_RTML/data/ --device=/dev/snd:/dev/snd previtus/demo-lstm-music-gen-cpu

xhost -SI:localuser:root

⁠2 Demo with a custom pre-trained LSTM model:

  • Place your trained .tfl model (all three files) into "__custom_saved_models"
  • Place the original songs wav into "__custom_music_samples/sample/"
  • Finally run:
xhost +SI:localuser:root
sudo docker run -it --rm --privileged=true --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --env="QT_X11_NO_MITSHM=1" -v $(pwd)/data/:/home/music_gen_interaction_RTML/data/ -v $(pwd)/__custom_saved_models/:/home/music_gen_interaction_RTML/__saved_models/ -v $(pwd)/__custom_music_samples/:/home/music_gen_interaction_RTML/__music_samples/ --device=/dev/snd:/dev/snd previtus/demo-lstm-music-gen-cpu
xhost -SI:localuser:root

⁠3 Training a new music LSTM model

You are better off with using the GPU version for the training - see here: https://hub.docker.com/repository/docker/previtus/demo-lstm-music-gen⁠

If you are set on using the CPU version, it might take longer and instead of the GPU memory it will require a larger RAM memory. Anyway, first place your wav file into "__music_samples/sample/ccastles.wav" (replace "ccastles.wav" with your file name) and then run:

xhost +SI:localuser:root
sudo docker run -it --rm --privileged=true --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --env="QT_X11_NO_MITSHM=1" -v $(pwd)/data/:/home/music_gen_interaction_RTML/data/ -v $(pwd)/__custom_saved_models/:/home/music_gen_interaction_RTML/__saved_models/ -v $(pwd)/__custom_music_samples/:/home/music_gen_interaction_RTML/__music_samples/ --device=/dev/snd:/dev/snd previtus/demo-lstm-music-gen-cpu python training_handler.py -target_file __music_samples/sample/ccastles.wav -amount_epochs 10 -batch_size 16
xhost -SI:localuser:root

Tag summary

Content type

Image

Digest

Size

1.5 GB

Last updated

over 6 years ago

docker pull previtus/demo-lstm-music-gen-cpu