GithubHelp home page GithubHelp logo

cifkao / groove2groove Goto Github PK

View Code? Open in Web Editor NEW
147.0 7.0 28.0 307 KB

Code for "Groove2Groove: One-Shot Music Style Transfer with Supervision from Synthetic Data"

Home Page: https://groove2groove.telecom-paris.fr

License: BSD 3-Clause "New" or "Revised" License

Python 55.89% Shell 5.51% Jupyter Notebook 38.60%
style-transfer music-style-transfer deep-learning neural-network tensorflow magenta paper papers-with-code

groove2groove's People

Contributors

cifkao avatar ivanlmh 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

groove2groove's Issues

[ Error ] Run trained model.

Hi. Thank you for sharing your code.
I run your code as you said and use the below command, replacing the $LOGDIR with the model directory.
However, I got this error

anaconda3/envs/groove2groove/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1534, in restore
raise ValueError("Can't load save_path when it is None.")
ValueError: Can't load save_path when it is None.

Replace $LOGDIR with the model directory, containing the model.yaml configuration file (e.g. one of the directories under experiments).

To run the trained model on a single pair of MIDI files, use the run-midi command, e.g.:

python -m groove2groove.models.roll2seq_style_transfer --logdir $LOGDIR run-midi
--sample --softmax-temperature 0.6
content.mid style.mid output.mid

[ Error ] on run-midi command

Hi. Thank you for sharing your code.
I run your code as you said and use the below command, replacing the $LOGDIR with the model directory.
However, I got this error

Replace $LOGDIR with the model directory, containing the model.yaml configuration file (e.g. one of the directories under experiments).

To run the trained model on a single pair of MIDI files, use the run-midi command, e.g.:

python -m groove2groove.models.roll2seq_style_transfer --logdir $LOGDIR run-midi --sample home/project/Desktop/Groove2groove/groove2groove/experiments/v01_drums_vel/v01_drums_vel/latest_checkpoint --softmax-temperature 0.6 content.mid style.mid output.mid

When i run this command, the following error occured.
OSError: no MTrk header at start of track

errorlog

Where can I download the style file ?

I downloaded the data set you shared via this website : [https://zenodo.org/record/3958000#.YNG5YXUzaV4]

I found this midi file like "maj500.BRITROK8_b.midi"

I guess maj500 is content and BRITROK8 is a style file.
And this midi file is an output of style embedding. Is that correct?

But not sure why there is a substyle a or b.
Could you explain this?
and where can I download the style file BRITROK8?

Thank you

[Error] Inference error: TensorArray has size zero, but element shape [?,200]

I think training is succeded somehow. There was no error during training.
And.. I just tested it with the midi files you showed on the demo web page.
Two input (content input, style input)

However, I get the below two errors. I think one is from rnn layers and not sure for the other one.

2021-04-23 22:51:39 seonghyeon-cbim tensorflow[53024] INFO Restoring parameters from experiments/v01/latest.ckpt-9600
2021-04-23 22:51:39 seonghyeon-cbim museflow[53024] INFO Variables restored from experiments/v01/latest.ckpt-9600
16it [00:00, 33.97it/s]
Traceback (most recent call last):
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.UnimplementedError: TensorArray has size zero, but element shape [?,200] is not fully defined. Currently only static shapes are supported when packing zero-size TensorArrays.
[[{{node encoder_rnn/rnn/TensorArrayStack/TensorArrayGatherV3}} = TensorArrayGatherV3[dtype=DT_FLOAT, element_shape=[?,200], _device="/job:localhost/replica:0/task:0/device:CPU:0"](encoder_rnn/rnn/TensorArray, encoder_rnn/rnn/TensorArrayStack/range, encoder_rnn/rnn/while/Exit_2)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/groove2groove/models/roll2seq_style_transfer.py", line 407, in
main()
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/groove2groove/models/roll2seq_style_transfer.py", line 401, in main
args.func(experiment, args)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/groove2groove/models/roll2seq_style_transfer.py", line 185, in run_midi
sequences = self._run_cli(args, pipeline)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/groove2groove/models/roll2seq_style_transfer.py", line 197, in _run_cli
sample=args.sample, softmax_temperature=args.softmax_temperature)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/groove2groove/models/roll2seq_style_transfer.py", line 211, in run
self.trainer.session, dataset, sample, softmax_temperature, options=options) or []
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/groove2groove/models/roll2seq_style_transfer.py", line 122, in run
options=options)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/museflow/model_utils.py", line 170, in run_over_dataset
options=options))
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/museflow/model_utils.py", line 139, in run
return session.run(fetches, feed_dict, options=options)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.UnimplementedError: TensorArray has size zero, but element shape [?,200] is not fully defined. Currently only static shapes are supported when packing zero-size TensorArrays.
[[node encoder_rnn/rnn/TensorArrayStack/TensorArrayGatherV3 (defined at /home/seonghyeon/anaconda3/envs/groove2groove/lib/python3.6/site-packages/museflow/components/rnn_layer.py:47) = TensorArrayGatherV3[dtype=DT_FLOAT, element_shape=[?,200], _device="/job:localhost/replica:0/task:0/device:CPU:0"](encoder_rnn/rnn/TensorArray, encoder_rnn/rnn/TensorArrayStack/range, encoder_rnn/rnn/while/Exit_2)]]

Sounds like an output midi lost a content input style.

I need an output that should maintain some of the content input style.
So I can tell it's from the content.
However, after style transfer, it's difficult to catch the content input style from the output.

Is there a way to conserve input music like 40 ~ 50 percent and add a different style?

Maybe this is the limitation of the current model?
I found that you added content input to an output midi again at the last stage in the demo site.

Is there the data preprocess code to band in a box?

I have download Band-in-a-box and refer to https://github.com/cifkao/pybiab. But there are still some problem that I can't fix. For example, I find the generation result from Real-Band is a little different every time. There are different notes every time I save the same song with the same style. And how to fix the wrong program number in MIDI files?
Thank you very much!

How long should I train to get the same result like demo ?

I assume you've got the best trained model from the configure in experiment/v01_drum.
I wonder how long I should train this model to reach your model on the demo website.

My best model is at checkpoint 8000 ~ 9000 and the loss is around 130~140.

Should I train more? or can you provide a pre-trained model?

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.