ratschlab / RGAN

Recurrent (conditional) generative adversarial networks for generating real-valued time series data.
https://arxiv.org/abs/1706.02633
MIT License
639 stars 181 forks source link

TypeError: must be real number, not str #31

Open Nimish9 opened 5 years ago

Nimish9 commented 5 years ago

Traceback (most recent call last): File "experiment.py", line 258, in print('%d\t%.2f\t%.4f\t%.4f\t%.5f\t%.0f\t %s\t %s' % (epoch, t, D_loss_curr, G_loss_curr, mmd2, that_np, pdf_sample, pdf_real)) TypeError: must be real number, not str

I am getting this error while running experiment.py on my data with "num_samples": 869, "seq_length": 300, "num_signals": 9.

a-posadas commented 5 years ago

That seems to be a print statement. If you use the format function you will be able to see the values. Something like: print('{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}'.format(epoch, t, D_loss_curr, G_loss_curr, mmd2, that_np, pdf_sample, pdf_real)) One of those digits is probably a nan. I don't know much about theory, but I've been playing around with this for about a week now, full disclosure. Just thought I'd try to help.

Nimish9 commented 5 years ago

@a-posadas Thank you for your help. There is a problem with mmd2!

a-posadas commented 5 years ago

I'm glad I could help. Apparently you can turn off mmd calculations according to this: https://github.com/ratschlab/RGAN/issues/16#issuecomment-359470046

However, that was due to memory problems, I'm not sure it applies in your case.

Nimish9 commented 5 years ago

@a-posadas ... and it is working without mmd. Thank you so much again for your help

a-posadas commented 5 years ago

Awesome!