conchylicultor / musicgenerator Goto Github PK
View Code? Open in Web Editor NEWExperiment diverse Deep learning models for music generation with TensorFlow
License: Apache License 2.0
Experiment diverse Deep learning models for music generation with TensorFlow
License: Apache License 2.0
I could not get to fix with tf.contrib when the tensorflow version is 2.5. Is there a way to get that working? Thanks!
kevinzhang@Kevins-MacBook-Pro-4 musicgenerator % python main.py
Traceback (most recent call last):
File "/Users/kevinzhang/MusicGenerator/main.py", line 24, in
import deepmusic
File "/Users/kevinzhang/MusicGenerator/deepmusic/init.py", line 3, in
from deepmusic.composer import Composer
File "/Users/kevinzhang/MusicGenerator/deepmusic/composer.py", line 34, in
from deepmusic.model import Model
File "/Users/kevinzhang/MusicGenerator/deepmusic/model.py", line 25, in
from deepmusic.keyboardcell import KeyboardCell
File "/Users/kevinzhang/MusicGenerator/deepmusic/keyboardcell.py", line 28, in
class KeyboardCell(tf.contrib.rnn.RNNCell):
AttributeError: module 'tensorflow' has no attribute 'contrib'
I have my dataset pointing to:
'--dataset_tag', type=str, default='beethoven'
and I've put some type 1
midi files inside a beethoven
folder, inside midi
directory.
now I get this traceback:
Welcome to DeepMusic v0.1 !
TensorFlow detected: v1.2.0
Current parameters:
glob_step: 0
keep_all: False
dataset_tag: beethoven
sample_length: 40
hidden_size: 512
num_layers: 2
target_weights: linear
scheduled_sampling: none
batch_size: 3
save_every: 1000
ratio_dataset: 0.9
testing_curve: 10
batch_builder: relative
learning_rate: cst
enco_cell: identity
deco_cell: lstm
loop_processing: sample_softmax
Training samples not found. Creating dataset from the songs...
Raw songs not found. Extracting from midi files...
File ignored (/Volumes/Dados/Documents/Code/Apps/VOCODER/MusicGenerator/MusicGenerator-master/data/midi/beethoven/sonate_01_(c)hisamori.mid): SMTPE timecode not supported (480 given)
File ignored (/Volumes/Dados/Documents/Code/Apps/VOCODER/MusicGenerator/MusicGenerator-master/data/midi/beethoven/sonate_07_(c)hisamori_Dmaj.mid): SMTPE timecode not supported (480 given)
File ignored (/Volumes/Dados/Documents/Code/Apps/VOCODER/MusicGenerator/MusicGenerator-master/data/midi/beethoven/sonate_14_(c)hisamori_C#minor.mid): SMTPE timecode not supported (480 given)
File ignored (/Volumes/Dados/Documents/Code/Apps/VOCODER/MusicGenerator/MusicGenerator-master/data/midi/beethoven/sonate_15_(c)hisamori_Dmaj.mid): SMTPE timecode not supported (480 given)
100%|███████████████████████████████████████████████████████| 4/4 [00:02<00:00, 1.79it/s]
Traceback (most recent call last):
File "main.py", line 29, in <module>
composer.main()
File "/Volumes/Dados/Documents/Code/Apps/VOCODER/MusicGenerator/MusicGenerator-master/deepmusic/composer.py", line 160, in main
self.music_data = MusicData(self.args)
File "/Volumes/Dados/Documents/Code/Apps/VOCODER/MusicGenerator/MusicGenerator-master/deepmusic/musicdata.py", line 64, in __init__
self._restore_dataset()
File "/Volumes/Dados/Documents/Code/Apps/VOCODER/MusicGenerator/MusicGenerator-master/deepmusic/musicdata.py", line 118, in _restore_dataset
self._create_raw_songs()
File "/Volumes/Dados/Documents/Code/Apps/VOCODER/MusicGenerator/MusicGenerator-master/deepmusic/musicdata.py", line 187, in _create_raw_songs
raise ValueError('Empty dataset. Check that the folder exist and contains supported midi files.')
ValueError: Empty dataset. Check that the folder exist and contains supported midi files.
what is wrong here?
In the composition of music, sometimes I need assistance with my music and need ideas, so this feature can be very helpful. It basically suggests notes patterns from the scale which suit half of the music which is already made, like the autocorrect feature in the text.
I have made a basic model for it, I will soon make a pool request.
tf.nn.seq2seq.rnn_decoder is no longer used in tensorflow 1.+, I changed it to tf.contrib.legacy_seq2seq.rnn_decoder but still did not work:
ValueError: Dimensions must be equal, but are 1024 and 525 for 'rnn_decoder/KeyboardCell/Decoder/Decoder/multi_rnn_cell/cell_0/basic_lstm_cell/MatMul_1' (op: 'MatMul') with input shapes: [64,1024], [525,2048].
I tried command "python main.py --test --sample_length 500"
But I got this error.
Can anyone know which file should I look through?
I know you pretty much abandoned this project, but i'm trying to make it work with tensorflow 0.12.1 and i'm getting this when the training "starts" (actually it freezes at 0% and then shows this error)
Model creation...
WARNING:tensorflow:From /media/sata/MusicGenerator/deepmusic/model.py:246 in _build_network.: scalar_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor or list of tags to a scalar summary op is no longer supported.
E tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:923] could not open file to read NUMA node: /sys/bus/pci/devices/0000:00:00.0/numa_node
Your kernel may have been built without NUMA support.
I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties:
name: NVIDIA Tegra X1
major: 5 minor: 3 memoryClockRate (GHz) 0.9984
pciBusID 0000:00:00.0
Total memory: 3.89GiB
Free memory: 2.85GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: NVIDIA Tegra X1, pci bus id: 0000:00:00.0)
E tensorflow/core/common_runtime/gpu/gpu_device.cc:586] Could not identify NUMA node of /job:localhost/replica:0/task:0/gpu:0, defaulting to 0. Your kernel may not have been built with NUMA support.
Initialize variables...
WARNING: No previous model found, but some files/folders found at /media/sata/MusicGenerator/save/model. Cleaning...
Removing /media/sata/MusicGenerator/save/model/train/events.out.tfevents.1511396622.tegra-ubuntu
Start training (press Ctrl+C to save and exit)...
------- Epoch 1 (lr=0.0001) -------
Subsampling the songs (train)...
Shuffling the dataset...
Generating batches...
Subsampling the songs (test)...
Shuffling the dataset...
Generating batches...
Training: 0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last):
File "main.py", line 29, in <module>
composer.main()
File "/media/sata/MusicGenerator/deepmusic/composer.py", line 197, in main
self._main_train()
File "/media/sata/MusicGenerator/deepmusic/composer.py", line 255, in _main_train
next_batch_test = batches_test[self.glob_step % len(batches_test)] # Generate test batches in a cycling way (test set smaller than train set)
ZeroDivisionError: integer division or modulo by zero
Any ideas?
Does this relates to the tags warning?
hi
how can i actually install deepmusic itself?
i can not import dependencies of deepmusic...
ModuleNotFoundError Traceback (most recent call last)
in ()
----> 1 from deepmusic.moduleloader import ModuleLoader
2 from deepmusic.keyboardcell import KeyboardCell
3 import deepmusic.songstruct as music
4 import numpy as np
5 import tensorflow
ModuleNotFoundError: No module named 'deepmusic'
Hi Conchylicultor,
Can you please provide some sample data.
Thanks
I downloaded a few midi files from internet but I get this error:
"Track 1 should not contain set_tempo"
Hello,
I cannot run the program, I have an error
File "../Deepstyle/MusicGenerator/deepmusic/musicdata.py", line 169, in _create_raw_songs
midi_files = [os.path.join(midi_dir, f) for f in os.listdir(midi_dir) if f.endswith(self.FILE_EXT)]
FileNotFoundError: [Errno 2] No such file or directory: '../Deepstyle/MusicGenerator/data/midi/ragtimemusic'
Can you help please?
John
When I run python main.py, it shows me an error like this:
Traceback (most recent call last):
File "main.py", line 24, in <module>
import deepmusic
File "C:\Users\User\freekode-projects\MusicGenerator\deepmusic\__init__.py", line 3, in <module>
from deepmusic.composer import Composer
File "C:\Users\User\freekode-projects\MusicGenerator\deepmusic\composer.py", line 31, in <module>
from deepmusic.musicdata import MusicData
File "C:\Users\User\freekode-projects\MusicGenerator\deepmusic\musicdata.py", line 27, in <module>
from deepmusic.midiconnector import MidiConnector
File "C:\Users\User\freekode-projects\MusicGenerator\deepmusic\midiconnector.py", line 20, in <module>
import mido # Midi lib
ModuleNotFoundError: No module named 'mido'
When I pip install it, it installs correctly:
Collecting mido
Downloading mido-1.2.9-py2.py3-none-any.whl (52 kB)
|████████████████████████████████| 52 kB 100 kB/s
Installing collected packages: mido
Successfully installed mido-1.2.9
But when I run main.py again:
Traceback (most recent call last):
File "main.py", line 24, in <module>
import deepmusic
File "C:\Users\User\freekode-projects\MusicGenerator\deepmusic\__init__.py", line 3, in <module>
from deepmusic.composer import Composer
File "C:\Users\User\freekode-projects\MusicGenerator\deepmusic\composer.py", line 31, in <module>
from deepmusic.musicdata import MusicData
File "C:\Users\User\freekode-projects\MusicGenerator\deepmusic\musicdata.py", line 27, in <module>
from deepmusic.midiconnector import MidiConnector
File "C:\Users\User\freekode-projects\MusicGenerator\deepmusic\midiconnector.py", line 20, in <module>
import mido # Midi lib
ModuleNotFoundError: No module named 'mido'
I'm on Windows 10.
I'm still 12 years old, so I might have missed telling you some information, and sorry for that.
Please help, and thank you in advance.
Do all notes of the output actually have the same length..or do i do anything wrong? =/ just notice this..i didnt see it before =,O
I did read readme and that it's only supposed to work on tensorflow 1.0
I updated the references to older methods
but now I'm getting
python main.py
Welcome to DeepMusic v0.1 !
TensorFlow detected: v1.3.0
Current parameters:
glob_step: 0
keep_all: False
dataset_tag: ragtimemusic
sample_length: 40
hidden_size: 512
num_layers: 2
target_weights: linear
scheduled_sampling: none
batch_size: 64
save_every: 1000
ratio_dataset: 0.9
testing_curve: 10
batch_builder: relative
learning_rate: cst
enco_cell: identity
deco_cell: lstm
loop_processing: sample_softmax
Restoring dataset from /Users/jpope/Documents/tensorflowWorkspace/MusicGenerator/data/samples/ragtimemusic-relative.pkl...
Loaded: 1 songs (0 train/1 test)
Model creation...
Traceback (most recent call last):
File "main.py", line 29, in
composer.main()
File "/Users/jpope/Documents/tensorflowWorkspace/MusicGenerator/deepmusic/composer.py", line 166, in main
self.model = Model(self.args)
File "/Users/jpope/Documents/tensorflowWorkspace/MusicGenerator/deepmusic/model.py", line 160, in init
self._build_network()
File "/Users/jpope/Documents/tensorflowWorkspace/MusicGenerator/deepmusic/model.py", line 215, in _build_network
loop_function=loop_rnn
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 152, in rnn_decoder
output, state = cell(inp, state)
File "/Users/jpope/Documents/tensorflowWorkspace/MusicGenerator/deepmusic/keyboardcell.py", line 76, in call
next_keyboard, next_state_deco = self.decoder.get_cell(prev_keyboard, (next_state_enco, prev_state[1]))
File "/Users/jpope/Documents/tensorflowWorkspace/MusicGenerator/deepmusic/modules/decoder.py", line 200, in get_cell
next_output, next_state = self.rnn_cell(prev_input, prev_states[1])
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 180, in call
return super(RNNCell, self).call(inputs, state)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 450, in call
outputs = self.call(inputs, *args, **kwargs)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 938, in call
cur_inp, new_state = cell(cur_inp, cur_state)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 774, in call
output, new_state = self._cell(inputs, state, scope)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 180, in call
return super(RNNCell, self).call(inputs, state)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 450, in call
outputs = self.call(inputs, *args, **kwargs)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 401, in call
concat = _linear([inputs, h], 4 * self._num_units, True)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1039, in _linear
initializer=kernel_initializer)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 1065, in get_variable
use_resource=use_resource, custom_getter=custom_getter)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 962, in get_variable
use_resource=use_resource, custom_getter=custom_getter)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 360, in get_variable
validate_shape=validate_shape, use_resource=use_resource)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 1405, in wrapped_custom_getter
*args, **kwargs)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 183, in _rnn_get_variable
variable = getter(*args, **kwargs)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 183, in _rnn_get_variable
variable = getter(*args, **kwargs)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 352, in _true_getter
use_resource=use_resource)
File "/Users/jpope/miniconda2/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py", line 669, in _get_single_variable
found_var.get_shape()))
ValueError: Trying to share variable rnn_decoder/KeyboardCell/Decoder/multi_rnn_cell/cell_0/basic_lstm_cell/kernel, but specified shape (1024, 2048) and found shape (525, 2048).
I get this error when i type in "main.py --test --sample_length 500"
Warning: No model found in 'C:\save/model'. Please train a model before trying to predict
The End! Thanks for using this program
but theres something in there..i allready trained it and it saved ..and theres something in the folder =/ pls help im so close.
AttributeError: module 'tensorflow._api.v1.nn' has no attribute 'seq2seq'
File "C:\musicai\deepmusic\composer.py", line 255, in _main_train
next_batch_test = batches_test[self.glob_step % len(batches_test)] # Generate test batches in a cycling way (test set smaller than train set)
ZeroDivisionError: integer division or modulo by zero
i allways get this =,O pls help (win 10 64bit)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.