Giter Club home page Giter Club logo

commu-code's People

Contributors

hyeonch avatar hyunlee103 avatar jesung-ryu avatar taehyun-poza 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

commu-code's Issues

what is duration_bins mean?

I want to take a midi file and test it through the encoder.

I've created a group with note items, and I'm wondering what 'duration_bins' means.
What do I need to create 'duration_bins'?

TypeError: 'type' object is not subscriptable

There is an error when running generate:

    chord_progression: list[str]
TypeError: 'type' object is not subscriptable

Might be because I'm using: Python 3.7.10, but the change below should be ok, as something similar is already used in the code.

Also I removed the fixed version for matplotlib, numpy, pandas and scipy to have it working on 3.7

 commu/midi_generator/container.py         | 9 ++++-----
 commu/midi_generator/info_preprocessor.py | 4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/commu/midi_generator/container.py b/commu/midi_generator/container.py
index 5357db4..b87d5ea 100644
--- a/commu/midi_generator/container.py
+++ b/commu/midi_generator/container.py
@@ -1,8 +1,7 @@
 import json
 from fractions import Fraction
 from pathlib import Path
-from typing import Dict, Any
-
+from typing import Dict, Any, List
 
 from pydantic import BaseModel, validator
 
@@ -21,10 +20,10 @@ class TransXlInputData(MidiMeta):
     num_generate: int
     top_k: int
     temperature: float
-    chord_progression: list[str]
+    chord_progression: List[str]
 
     @validator("chord_progression")
-    def validate_chord_progression_length(cls, value: list[str], values: Dict[str, Any]) -> list[str]:
+    def validate_chord_progression_length(cls, value: List[str], values: Dict[str, Any]) -> List[str]:
         num_measures = values.get("num_measures")
         time_signature = values.get("time_signature")
         expected_result = (num_measures - (num_measures % 4)) * Fraction(time_signature) * 8
@@ -65,4 +64,4 @@ class TransXlInputData(MidiMeta):
         return chord_token_components
 
     def to_dict(self) -> Dict[str, Any]:
-        return json.loads(self.json())
\ No newline at end of file
+        return json.loads(self.json())
diff --git a/commu/midi_generator/info_preprocessor.py b/commu/midi_generator/info_preprocessor.py
index 9368805..cd032c0 100644
--- a/commu/midi_generator/info_preprocessor.py
+++ b/commu/midi_generator/info_preprocessor.py
@@ -13,7 +13,7 @@ def encode_meta(meta_encoder: MetaEncoder, midi_meta: MidiMeta) -> List[int]:
     return meta_encoder.encode(midi_meta)
 
 
-def normalize_chord_progression(chord_progression: str) -> list[str]:
+def normalize_chord_progression(chord_progression: str) -> List[str]:
     return chord_progression.split("-")
 
 
@@ -42,4 +42,4 @@ class PreprocessTask:
             self.normalize_input_data(input_data)
 
         encoded_meta = self.preprocess()
-        return encoded_meta
\ No newline at end of file
+        return encoded_meta
-- 
2.34.1

single gpu 관련

single gpu 에서 학습시에 train 부분에 ddp 를 제거하여 학습하였으나
무음이 생성되었고
generate 단에서 write 하는 부분을 살펴보니
image
해당 부분에서 position 이후에 note velocity, note on, note duration 이 출력되는 경우가 맨처음 이외에는 존재하지 않았고 그문제로 음악이 제대로 생성되지 않는 것이었습니다.
해당 코드 부분에 의미를 조금 설명해주실 수 있나요?
events 다음에 note velocity, note on, note duration이 차례대로 나와야지만 temp_notes 에 append 가 가능한 이유가 궁금합니다

Can you upload the checkpoint you use to generate the demo please?

Hello~
Thanks for your great work! I'm writing to ask if you can upload the checkpoint you use to generate the demo audio, for I'm having trouble reproducing your result. The results generated by my model have poor controllability and don't sound like real music, and I'm wondering if there's something wrong with my training.

Issues in the generation step

Hi,

I ran both the preprocessing and the training as described in the README (after your last commit). However, when I try to generate a sample with the metadata reported as an example in the README, namely

--bpm 70 \
--audio_key aminor \
--time_signature 4/4 \
--pitch_range mid_high \
--num_measures 8 \
--inst acoustic_piano \
--genre newage \
--min_velocity 60 \
--max_velocity 80 \
--track_role main_melody \
--rhythm standard \
--chord_progression Am-Am-Am-Am-Am-Am-Am-Am-G-G-G-G-G-G-G-G-F-F-F-F-F-F-F-F-E-E-E-E-E-E-E-E-Am-Am-Am-Am-Am-Am-Am-Am-G-G-G-G-G-G-G-G-F-F-F-F-F-F-F-F-E-E-E-E-E-E-E-E \
--num_generate 3

I either get (when using checkpoint_best.pt)

UserWarning: Setting attributes on ParameterList is not supported.
2022-11-20 15:13:37,406 | INFO | ComMU | Generating the idx: 1
2022-11-20 15:13:39,677 | INFO | ComMU | correct_length: 8
2022-11-20 15:13:39,677 | INFO | ComMU | <list of indexes>
2022-11-20 15:13:39,677 | ERROR | ComMU | Empty sequence generated
2022-11-20 15:13:39,678 | INFO | ComMU | Generating the idx: 1
2022-11-20 15:13:41,024 | INFO | ComMU | correct_length: 8
2022-11-20 15:13:41,024 | INFO | ComMU | <list of indexes>
2022-11-20 15:13:41,025 | ERROR | ComMU | Empty sequence generated
2022-11-20 15:13:41,025 | INFO | ComMU | Generating the idx: 1
2022-11-20 15:13:42,897 | INFO | ComMU | correct_length: 8
2022-11-20 15:13:42,897 | INFO | ComMU | <list of indexes>

which loops forever, or (when using checkpoint_last.pt)

UserWarning: Setting attributes on ParameterList is not supported.
2022-11-20 15:30:45,402 | INFO | ComMU | Generating the idx: 1
2022-11-20 15:31:05,013 | ERROR | ComMU | remnant chord length: 8 
error in teacher forcing
2022-11-20 15:31:05,013 | INFO | ComMU | Generating the idx: 1
2022-11-20 15:31:24,684 | ERROR | ComMU | remnant chord length: 8 
error in teacher forcing

which also loops forever.

What is the issue? The only change that I made is a reduction in the batch size to fit the data in my (single) GPU.

Alternatively, Is there any way you could give me a checkpoint like the one you used to generate the demos in the project page?

error in teacher forcing

Is the current dataset ok to train the model so that we could run the example?
The csv has 3995 references, while the archive contains 11000 entries.

After training, based on that, the generate method does not work. For the next token in the sequence it generates 'generation_length' values between 564 and 592, never entering the clauses to pop a chord.

So, in the end the generate method is stuck in a infinite loop, always generating: "error in teacher forcing" at index = 1.

Is there any way to get your already 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.