Closed ericosmic closed 5 years ago
Could you provide the configuration and error messages so that I can diagnose your problem?
In general, for two stage training, you need to set SETUP['two_stage_training']
to True and CONIFG['training_phase']
to 'pretrain' in the first stage. After you complete the first stage training, you then set CONIFG['training_phase']
to 'train' for the second stage training.
My config setup:
the error message, it just stop running and jump out :
Oh...I see. You are using the source code from another repo (musegan). I found the bug. You need to change the following line in main.py
:
if CONFIG['train']['training_phase'] == 'two_stage':
to
if CONFIG['train']['training_phase'] == 'second_stage':
Thanks ,I would change the config and retry. Actually , I have another doubt when the mode is training , it would often give a warning like this:
What is reason about it ?
If it would affect the result of training?
That won't affect the training. You can suppress it by modifying part of the source code in function tonal_dist
in bmusegan/musegan/utils/metric.py
to:
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=RuntimeWarning)
chroma1 = chroma1 / np.sum(chroma1)
chroma2 = chroma2 / np.sum(chroma2)
result1 = np.matmul(tonal_matrix, chroma1)
result2 = np.matmul(tonal_matrix, chroma2)
I tried to train bmusegan model by the source code in musegan github , it always stop in the 'initializing variables' step and jump out . So I check the source program and find the problem maybe happen in the main.py , when we choose second_stage training phase , the program still jump into first_stage's class GAN and cause the initial wrong .