Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"rander_graphs" error #7

Closed
li-zemin opened this issue May 2, 2018 · 2 comments
Closed

"rander_graphs" error #7

li-zemin opened this issue May 2, 2018 · 2 comments

Comments

@li-zemin
Copy link

li-zemin commented May 2, 2018

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!

@EdwardSmith1884
Copy link
Owner

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.

@li-zemin
Copy link
Author

li-zemin commented May 9, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants