Giter VIP home page Giter VIP logo

dsnd_term1's Issues

Value Error in Notebook 'Part 7 - Loading Image Data (Exercises)' in intro-to-pytorch

This Error occurs while running the Solution given in Notebook

Error

Error

Error in callback <function install_repl_displayhook..post_execute at 0x7f60a397e6a8> (for post_execute):

ValueError Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/matplotlib/pyplot.py in post_execute()
145 def post_execute():
146 if matplotlib.is_interactive():
--> 147 draw_all()
148
149 # IPython >= 2

/opt/conda/lib/python3.6/site-packages/matplotlib/_pylab_helpers.py in draw_all(cls, force)
148 for f_mgr in cls.get_all_fig_managers():
149 if force or f_mgr.canvas.figure.stale:
--> 150 f_mgr.canvas.draw_idle()
151
152 atexit.register(Gcf.destroy_all)

/opt/conda/lib/python3.6/site-packages/matplotlib/backend_bases.py in draw_idle(self, *args, **kwargs)
2051 if not self._is_idle_drawing:
2052 with self._idle_draw_cntx():
-> 2053 self.draw(*args, **kwargs)
2054
2055 def draw_cursor(self, event):

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in draw(self)
428 if toolbar:
429 toolbar.set_cursor(cursors.WAIT)
--> 430 self.figure.draw(self.renderer)
431 finally:
432 if toolbar:

/opt/conda/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/opt/conda/lib/python3.6/site-packages/matplotlib/figure.py in draw(self, renderer)
1293
1294 mimage._draw_list_compositing_images(
-> 1295 renderer, self, artists, self.suppressComposite)
1296
1297 renderer.close_group('figure')

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
136 if not_composite or not has_images:
137 for a in artists:
--> 138 a.draw(renderer)
139 else:
140 # Composite any adjacent images together

/opt/conda/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/opt/conda/lib/python3.6/site-packages/matplotlib/axes/_base.py in draw(self, renderer, inframe)
2397 renderer.stop_rasterizing()
2398
-> 2399 mimage._draw_list_compositing_images(renderer, self, artists)
2400
2401 renderer.close_group('axes')

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
136 if not_composite or not has_images:
137 for a in artists:
--> 138 a.draw(renderer)
139 else:
140 # Composite any adjacent images together

/opt/conda/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in draw(self, renderer, *args, **kwargs)
546 else:
547 im, l, b, trans = self.make_image(
--> 548 renderer, renderer.get_image_magnification())
549 if im is not None:
550 renderer.draw_image(gc, l, b, im)

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in make_image(self, renderer, magnification, unsampled)
772 return self._make_image(
773 self._A, bbox, transformed_bbox, self.axes.bbox, magnification,
--> 774 unsampled=unsampled)
775
776 def _check_unsampled_image(self, renderer):

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification, unsampled, round_to_pixel_border)
464 # (of int or float)
465 # or an RGBA array of re-sampled input
--> 466 output = self.to_rgba(output, bytes=True, norm=False)
467 # output is now a correctly sized RGBA array of uint8
468

/opt/conda/lib/python3.6/site-packages/matplotlib/cm.py in to_rgba(self, x, alpha, bytes, norm)
255 if xx.dtype.kind == 'f':
256 if norm and xx.max() > 1 or xx.min() < 0:
--> 257 raise ValueError("Floating point image RGB values "
258 "must be in the 0..1 range.")
259 if bytes:

ValueError: Floating point image RGB values must be in the 0..1 range.


ValueError Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/IPython/core/formatters.py in call(self, obj)
339 pass
340 else:
--> 341 return printer(obj)
342 # Finally look for special method names
343 method = get_real_method(obj, self.print_method)

/opt/conda/lib/python3.6/site-packages/IPython/core/pylabtools.py in (fig)
241 png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
242 if 'retina' in formats or 'png2x' in formats:
--> 243 png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))
244 if 'jpg' in formats or 'jpeg' in formats:
245 jpg_formatter.for_type(Figure, lambda fig: print_figure(fig, 'jpg', **kwargs))

/opt/conda/lib/python3.6/site-packages/IPython/core/pylabtools.py in retina_figure(fig, **kwargs)
131 def retina_figure(fig, **kwargs):
132 """format a figure as a pixel-doubled (retina) PNG"""
--> 133 pngdata = print_figure(fig, fmt='retina', **kwargs)
134 # Make sure that retina_figure acts just like print_figure and returns
135 # None when the figure is empty.

/opt/conda/lib/python3.6/site-packages/IPython/core/pylabtools.py in print_figure(fig, fmt, bbox_inches, **kwargs)
123
124 bytes_io = BytesIO()
--> 125 fig.canvas.print_figure(bytes_io, **kw)
126 data = bytes_io.getvalue()
127 if fmt == 'svg':

/opt/conda/lib/python3.6/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
2206 orientation=orientation,
2207 dryrun=True,
-> 2208 **kwargs)
2209 renderer = self.figure._cachedRenderer
2210 bbox_inches = self.figure.get_tightbbox(renderer)

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)
505
506 def print_png(self, filename_or_obj, *args, **kwargs):
--> 507 FigureCanvasAgg.draw(self)
508 renderer = self.get_renderer()
509 original_dpi = renderer.dpi

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in draw(self)
428 if toolbar:
429 toolbar.set_cursor(cursors.WAIT)
--> 430 self.figure.draw(self.renderer)
431 finally:
432 if toolbar:

/opt/conda/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/opt/conda/lib/python3.6/site-packages/matplotlib/figure.py in draw(self, renderer)
1293
1294 mimage._draw_list_compositing_images(
-> 1295 renderer, self, artists, self.suppressComposite)
1296
1297 renderer.close_group('figure')

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
136 if not_composite or not has_images:
137 for a in artists:
--> 138 a.draw(renderer)
139 else:
140 # Composite any adjacent images together

/opt/conda/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/opt/conda/lib/python3.6/site-packages/matplotlib/axes/_base.py in draw(self, renderer, inframe)
2397 renderer.stop_rasterizing()
2398
-> 2399 mimage._draw_list_compositing_images(renderer, self, artists)
2400
2401 renderer.close_group('axes')

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
136 if not_composite or not has_images:
137 for a in artists:
--> 138 a.draw(renderer)
139 else:
140 # Composite any adjacent images together

/opt/conda/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in draw(self, renderer, *args, **kwargs)
546 else:
547 im, l, b, trans = self.make_image(
--> 548 renderer, renderer.get_image_magnification())
549 if im is not None:
550 renderer.draw_image(gc, l, b, im)

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in make_image(self, renderer, magnification, unsampled)
772 return self._make_image(
773 self._A, bbox, transformed_bbox, self.axes.bbox, magnification,
--> 774 unsampled=unsampled)
775
776 def _check_unsampled_image(self, renderer):

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification, unsampled, round_to_pixel_border)
464 # (of int or float)
465 # or an RGBA array of re-sampled input
--> 466 output = self.to_rgba(output, bytes=True, norm=False)
467 # output is now a correctly sized RGBA array of uint8
468

/opt/conda/lib/python3.6/site-packages/matplotlib/cm.py in to_rgba(self, x, alpha, bytes, norm)
255 if xx.dtype.kind == 'f':
256 if norm and xx.max() > 1 or xx.min() < 0:
--> 257 raise ValueError("Floating point image RGB values "
258 "must be in the 0..1 range.")
259 if bytes:

ValueError: Floating point image RGB values must be in the 0..1 range.

<matplotlib.figure.Figure at 0x7f607466c780>

Wrong shape in Code Cell 1 of Notebook "Part 3 - Training neural networks" (excercise as well as solution)?

To me it seems as if there was an error in Notebook(s) "Part 3 - Training neural networks":
When executing Code-Cell 1 with transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)), ]) Code-Cell 2 produces an error stating RuntimeError: output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28].

In my opinion it should be transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,)), ]) (like in Part 2).

Thanks for checking and amending if necessary!

Clone

I can't see any cloning option

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.