cifar10数据集“超出最大允许大小”错误

时间:2019-02-03 15:36:33

标签: matplotlib

根据Capslayer Tutorials,我为cifar10数据集进行了安排。然后我开始训练。转到步骤499后,出现以下错误(我将批大小减小到1,但结果是相同的)。有什么解决方案?

 step: 493, loss: 0.427, time: 0.033 sec/step
 step: 494, loss: 0.425, time: 0.034 sec/step
 step: 495, loss: 0.366, time: 0.033 sec/step
 step: 496, loss: 0.433, time: 0.034 sec/step
 step: 497, loss: 0.374, time: 0.033 sec/step
 step: 498, loss: 0.358, time: 0.034 sec/step
 step: 499, loss: 0.382, time: 0.033 sec/step
 evaluating, it will take a while...
 Traceback (most recent call last):
 File "main.py", line 237, in <module>
 tf.app.run()
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 124, in run
_sys.exit(main(argv))
 File "main.py", line 231, in main
 train(net, data_loader)
 File "main.py", line 137, in train
plot_activation(np.hstack((probs, targets)), step=step, save_to=path)
 File "/home/atakan/.local/lib/python3.6/site-packages/capslayer-0.1.5-py3.6.egg/capslayer/plotlib/figure.py", line 52, in plot_activation
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py", line 697, in savefig
res = fig.savefig(*args, **kwargs)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/figure.py", line 1573, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 222, in print_figure
FigureCanvasAgg.print_figure(self, *args, **kwargs)
File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 2252, in print_figure
**kwargs)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 545, in print_png
FigureCanvasAgg.draw(self)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 464, in draw
self.figure.draw(self.renderer)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py", line 63, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/figure.py", line 1144, in draw
renderer, self, dsu, self.suppressComposite)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/image.py", line 139, in _draw_list_compositing_images
a.draw(renderer)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py", line 63, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 2426, in draw
mimage._draw_list_compositing_images(renderer, self, dsu)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/image.py", line 139, in _draw_list_compositing_images
a.draw(renderer)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py", line 63, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/axis.py", line 1136, in draw
ticks_to_draw = self._update_ticks(renderer)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/axis.py", line 969, in _update_ticks
tick_tups = [t for t in self.iter_ticks()]
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/axis.py", line 969, in <listcomp>
tick_tups = [t for t in self.iter_ticks()]
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/axis.py", line 912, in iter_ticks
majorLocs = self.major.locator()
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/ticker.py", line 1367, in __call__
return self.tick_values(dmin, dmax)
 File "/home/atakan/anaconda3/lib/python3.6/site-packages/matplotlib/ticker.py", line 1371, in tick_values
np.arange(vmin + self.offset, vmax + 1, self._base))
ValueError: Maximum allowed size exceeded

1 个答案:

答案 0 :(得分:0)

尝试升级matplotlib。从2.x版本升级到3.x之前,我遇到了同样的问题,现在一切正常。