深層学習における学習過程の可視化を中間層出力からやってみるを実行したのですが、実際に学習させるところで
python
1acc, val_acc, loss, val_loss = train(model, X_train, y_train, epoch=100, batch=100)
UMAP(dens_frac=0.0, dens_lambda=0.0, n_neighbors=40, verbose=1) Construct fuzzy simplicial set Tue Jul 27 12:35:22 2021 Finding Nearest Neighbors Tue Jul 27 12:35:22 2021 Building RP forest with 17 trees Tue Jul 27 12:35:23 2021 NN descent for 16 iterations 1 / 16 2 / 16 3 / 16 Stopping threshold met -- exiting after 3 iterations Tue Jul 27 12:35:28 2021 Finished Nearest Neighbor Search Tue Jul 27 12:35:28 2021 Construct embedding completed 0 / 200 epochs completed 20 / 200 epochs completed 40 / 200 epochs completed 60 / 200 epochs completed 80 / 200 epochs completed 100 / 200 epochs completed 120 / 200 epochs completed 140 / 200 epochs completed 160 / 200 epochs completed 180 / 200 epochs Tue Jul 27 12:35:49 2021 Finished embedding --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) /var/folders/72/fl6l29ds4xvbv0zcgdzj4wc00000gn/T/ipykernel_3975/2994000927.py in <module> ----> 1 acc, val_acc, loss, val_loss = train(model, X_train, y_train, epoch=100, batch=100) /var/folders/72/fl6l29ds4xvbv0zcgdzj4wc00000gn/T/ipykernel_3975/3045578850.py in train(model, X_train, y_train, epoch, batch) 17 plt.colorbar() 18 plt.title('Epoch ' + str(i)) ---> 19 plt.savefig('./fig/epoch_' + '{0:03d}'.format(i) + '.png', bbox_inches='tight') 20 plt.close() 21 # 1epochだけ学習 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/pyplot.py in savefig(*args, **kwargs) 964 def savefig(*args, **kwargs): 965 fig = gcf() --> 966 res = fig.savefig(*args, **kwargs) 967 fig.canvas.draw_idle() # need this if 'transparent=True' to reset colors 968 return res /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/figure.py in savefig(self, fname, transparent, **kwargs) 3003 patch.set_edgecolor('none') 3004 -> 3005 self.canvas.print_figure(fname, **kwargs) 3006 3007 if transparent: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs) 2259 orientation=orientation, 2260 bbox_inches_restore=_bbox_inches_restore, -> 2261 **kwargs) 2262 finally: 2263 if bbox_inches and restore_bbox: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/backend_bases.py in wrapper(*args, **kwargs) 1667 kwargs.pop(arg) 1668 -> 1669 return func(*args, **kwargs) 1670 1671 return wrapper /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py in print_png(self, filename_or_obj, metadata, pil_kwargs, *args) 509 mpl.image.imsave( 510 filename_or_obj, self.buffer_rgba(), format="png", origin="upper", --> 511 dpi=self.figure.dpi, metadata=metadata, pil_kwargs=pil_kwargs) 512 513 def print_to_buffer(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/matplotlib/image.py in imsave(fname, arr, vmin, vmax, cmap, format, origin, dpi, metadata, pil_kwargs) 1614 pil_kwargs.setdefault("format", format) 1615 pil_kwargs.setdefault("dpi", (dpi, dpi)) -> 1616 image.save(fname, **pil_kwargs) 1617 1618 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/Image.py in save(self, fp, format, **params) 2167 fp = builtins.open(filename, "r+b") 2168 else: -> 2169 fp = builtins.open(filename, "w+b") 2170 2171 try: FileNotFoundError: [Errno 2] No such file or directory: './fig/epoch_000.png'
となってしまいます。
どうしたらいいでしょうか?