Git Product home page Git Product logo

musicgenerator's People

Contributors

conchylicultor avatar thepsyntist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

musicgenerator's Issues

Error on tf.contrib

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'

SMTPE timecode not supported (480 given)

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?

Can not run in tensorflow version 1.+

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].

Error when training starts. ZeroDivisionError: integer division or modulo by zero

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?

deepmusic lib

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'

Sample Data

Hi Conchylicultor,

Can you please provide some sample data.

Thanks

MIDI files problem

I downloaded a few midi files from internet but I get this error:
"Track 1 should not contain set_tempo"

Cannot run the program

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

ModuleNotFoundError: No module named 'mido' even though I just pip installed it on Windows

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.

Output question

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

attempting to use tensorflow-1.3 - but getting error - 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 did read readme and that it's only supposed to work on tensorflow 1.0

I updated the references to older methods

screen shot 2017-09-06 at 11 48 58 am

screen shot 2017-09-06 at 11 48 54 am

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).

Finds no model

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.

ZeroDivisionError

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.