Closed babyandy0111 closed 7 years ago
Hi there,
Do you want to train a new model or just categorize a bunch of audio files with a (the) pre-trained model?
1) for categorization with an existing model, use:
python rp_classify.py input_path
python rp_classify.py input_path model_filename
2) if you want to train your own model, you need to provide the genre (or other) categories alongside with each audio file!
there is 2 ways to do it:
a) if your input folder is organized by subgenre, e.g.
D:/python/song_style/music/pop
D:/python/song_style/music/rock D:/python/song_style/music/electro
etc.
you should be able to use:
python rp_classify.py -t D:/python/song_style/music output_model_file
b) otherwise, you’ll need to provide a CSV (actually tab-separated) file, where all the input audio files are listed (relative path) + TAB + a genre label, e.g.:
Blur_Song2.mp3 pop path/to/Metallica_Nothing_Else.mp3 rock ...
Then provide this file via the -c parameter:
python rp_classify.py -t -c class_label_file.csv D:/python/song_style/music output_model_file
Hope that helps, best Thomas
Am 28.03.2017 um 10:41 schrieb babyandy0111 notifications@github.com:
Hi, I'm a python beginner I use this command "D:\python\song_style>python rp_classify.py -t D:/python/song_style/music pop" but always show me "Class label could not be derived from filename! Filename must contain a sub-directory path to be used as class label. Otherwise provide a class label file."
i use windows7 , python 2.7
please help me, what can i do
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tuwien-musicir/rp_extract/issues/20, or mute the thread https://github.com/notifications/unsubscribe-auth/ALHE6dHAo5I0xNo3faco5882HPShnVY-ks5rqMfEgaJpZM4MrTqc.
-- Thomas Lidy Vienna University of Technology Institute of Software Technology and Interactive Systems Favoritenstraße 9-11/188 A-1040 Vienna, Austria
Hi Thomas thanks for your help. i can't train my model.
i follow step 2, but can't train my model model_filename is dir path or just filename?
thank you very much.
If ttt.txt contains your labels, you need to put -c in front of it!
Your model file is a path + filename.
So your command should be:
python rp_classify.py -t -c ttt.txt D:/python/song_style/music D:/python/…/mymodel
Note that you cannot train a model with a single audio file! You should have dozens, hundreds or thousands of songs annotated in order for Machine Learning to make sense of it.
best Thomas
Am 28.03.2017 um 11:43 schrieb babyandy0111 notifications@github.com:
Hi Thomas thanks for your help. i can't train my model.
https://cloud.githubusercontent.com/assets/8206379/24398709/0ebf55c6-13dd-11e7-8cf3-2528e5b67aa4.png https://cloud.githubusercontent.com/assets/8206379/24398966/d067e4ea-13dd-11e7-8a9e-2d8c2d34b509.png https://cloud.githubusercontent.com/assets/8206379/24399055/13107802-13de-11e7-96f7-12087fea4230.png i follow step 2, but can't train my model model_filename is dir path or just filename?
thank you very much.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tuwien-musicir/rp_extract/issues/20#issuecomment-289718224, or mute the thread https://github.com/notifications/unsubscribe-auth/ALHE6Ty_rp9wM6fB4B8ygMXPOOfeVgHMks5rqNZWgaJpZM4MrTqc.
-- Thomas Lidy Vienna University of Technology Institute of Software Technology and Interactive Systems Favoritenstraße 9-11/188 A-1040 Vienna, Austria
Hi Thomas I try it. it work. but have other error: ValueError: dictionary update sequence element #0 has length 1; 2 is required
this is my txt. i use default TAB-separated Class.txt
this is my command python rp_classify.py -t -c D:/python/song_style/Class.txt D:/python/song_style/music D:/python/mymodel
what i lost ? Thanks again.
Hi i tried edit source code and txt file, but i have another problem
this is error message and my txt file Class.txt
this is my musid dir
please, tell me what can i do ? thank you very much
Hi,
If you use D:/python/song_style/music as your input_path: python rp_classify.py -t -c D:/python/song_style/Class.txt D:/python/song_style/music D:/python/mymodel
then the file listing in the .txt file should contain paths relative to that, i.e.
Latin\1.wav Latin Latin\2.wav Latin ... Funk\1.wav Funk Funk\2.wav Funk
That is the best way to do it, as it will not allow you to use duplicate „file_ids“ in neither the feature file nor the class.txt file, but with the relative paths (Latin\1.wav and Funk\1.wav) you are fine.
best Thomas
Am 29.03.2017 um 09:44 schrieb babyandy0111 notifications@github.com:
Hi i tried edit source code and txt file, but i have another problem
this is error message and my txt file https://cloud.githubusercontent.com/assets/8206379/24443609/e36d054e-1495-11e7-8499-b1fffd05fdb2.png Class.txt https://github.com/tuwien-musicir/rp_extract/files/878174/Class.txt this is my musid dir https://cloud.githubusercontent.com/assets/8206379/24443664/1481f964-1496-11e7-980b-c7235d2ce76e.png please, tell me what can i do ? thank you very much
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tuwien-musicir/rp_extract/issues/20#issuecomment-290010057, or mute the thread https://github.com/notifications/unsubscribe-auth/ALHE6RZEkjZSjO5LIrcsvLWC-KuFyFFBks5rqgvNgaJpZM4MrTqc.
-- Thomas Lidy Vienna University of Technology Institute of Software Technology and Interactive Systems Favoritenstraße 9-11/188 A-1040 Vienna, Austria
Hi Thomas thanks for your help :)
Hi, I'm a python beginner I use this command "D:\python\song_style>python rp_classify.py -t D:/python/song_style/music pop" but always show me "Class label could not be derived from filename! Filename must contain a sub-directory path to be used as class label. Otherwise provide a class label file."
i use windows7 , python 2.7
please help me, what can i do