Closed li-zemin closed 6 years ago
I think I may have fixed the issue, I had a bug which allowed this section of code to be called too early. Can you check if it now works for you? btw for your information savitzky_golay is just a function to give a smooth average over the loss at each iteration. You can remove this line and the training will not be affected.
Thanks for your reply, The bug was fixed out in your code newly pushed. And your code shared was a great help to me. I have a lot to learn from you. Looking forward to communicating with you in the field of 3D Deep Learning. Thank you very much!
Hi, Thanks for your code, When I trained 3D-VAE-IWGAN, a error happened around of "rander_graphs":
Traceback (most recent call last): File "20-VAE-3D-IWGAN.py", line 162, in
track_valid_loss) # this will only work after a 50 iterations to allows for proper averating
File "../scripts/GANutils.py", line 224, in render_graphs
plt.plot(track_d_loss_iter, smoothed_d_loss, color = 'red')
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 3261, in plot
ret = ax.plot(*args, kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/init.py", line 1717, in inner
return func(ax, *args, *kwargs)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_axes.py", line 1372, in plot
for line in self._get_lines(args, kwargs):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 404, in _grab_next_args
for seg in self._plot_args(this, kwargs):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 384, in _plot_args
x, y = self._xy_from_xy(x, y)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 243, in _xy_from_xy
"have shapes {} and {}".format(x.shape, y.shape))
ValueError: x and y must have same first dimension, but have shapes (56,) and (136,)
And I printed the length of "track_d_loss_iter" and "smoothed_d_loss", the length of "track_d_loss_iter" equals to(training set number / batch_size). The length of "smoothed_d_loss" comes from the function "def savitzky_golay(y, window_size, order, deriv=0, rate=1):". I have tried my best to understand the function, however, I could not fix this bug by myself. And, could you help me: Thanks!