Нужно вывести/скачать csv файл нейросети как это сделать? import tensorflow as tf

from tensorflow.keras import layers
from tensorflow.keras import Model
from tensorflow.keras.applications.inception_v3 import InceptionV3
from tensorflow.keras.optimizers import RMSprop
import numpy as np
import matplotlib.pyplot as plt
import tensorflow_datasets as tfds
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.layers import Flatten,Dense,Dropout# Load Minist data
ds_train,ds_test = tfds.load('mnist',split=['train','test'],as_supervised=True)# explore data

for image,label in ds_train.take(1):
  print(f'shape of the images:{image.shape} and label number:{label}')

print(f'trian size:{len(ds_train)}')
print(f'test size:{len(ds_test)}')# split train and validation set

# Get the total number of examples in the training set

num_train =len(ds_train)
validation_split = 0.2

num_validation_exmples = int(num_train*validation_split)

ds_train_nw = ds_train.take(num_train-num_validation_exmples)
ds_val = ds_train.skip(num_train-num_validation_exmples)

print(f'new size of train set:{len(ds_train_nw)}')
print(f'size of validation set:{len(ds_val)}')# viszulaize data


def plot_images(data,num=5):

  figure = plt.figure(figsize=(10,4))

  for i,(image,label) in enumerate(data.take(num)):

    plt.subplot(1,num,i+1)

    plt.imshow(image.numpy().squeeze())

    plt.title(f'label:{label.numpy()}')

    plt.axis('off')

  plt.show()


plot_images(ds_train_nw)# resize input images in order to train with 'InceptionV3'


def resizer(image,label):
  #resize image to 75,75
  image = tf.image.resize(image,(75,75))

  # Duplicate one channel to 3 chanels

  image = tf.image.grayscale_to_rgb(image)

  # normailze image data
  image = tf.cast(image,dtype=tf.float32)/255.0

  return image,label# resize train and test images

ds_train_pr = ds_train_nw.map(resizer)
ds_test_pr = ds_test.map(resizer)
ds_val_pr = ds_val.map(resizer)# check new shape of the image data

for image,label in ds_test_pr.take(1):
  print(f'new shape after resize test:{image.shape}')
# split images into batches

batch_size = 128

ds_train_pr = ds_train_pr.shuffle(buffer_size=48000).batch(batch_size).cache().prefetch(tf.data.experimental.AUTOTUNE)

ds_test_pr = ds_test_pr.shuffle(buffer_size=10000).batch(batch_size).cache().prefetch(tf.data.experimental.AUTOTUNE)

ds_val_pr = ds_val_pr.shuffle(buffer_size=12000).batch(batch_size).cache().prefetch(tf.data.experimental.AUTOTUNE)# check new shape of procssed batches

for image,label in ds_train_pr.take(1):
  print(f"finale shape of train images:{image.shape}")
for image,label in ds_test_pr.take(1):
  print(f"finale shape of test images:{image.shape}")# build the model

pre_trained_model = InceptionV3(input_shape=(75,75,3),include_top=False,weights='imagenet')



# Frezze weight of the layers

for layer in pre_trained_model.layers:
  layer.trainable = False
# Get 'mixed9' layer as the last layer

last_layer = pre_trained_model.get_layer('mixed9')


# print the shape of last layer

print(f'last layer shape:')

last_output = last_layer.outputx = Flatten()(last_output)
x = Dense(units=1024,activation='relu')(x)
x = Dropout(0.2)(x)
x = Dense(units=10,activation='softmax')(x)

model = Model(pre_trained_model.input,x)

#get the summary

model.summary() # callback

class CallBack(tf.keras.callbacks.Callback):
  def on_epoch_end(self, epoch, logs={}):
    if logs.get('val_accuracy')>0.98:
      print('stop traning')
      self.model.stop_training=Truecallback = CallBack()
hist=model.fit(ds_train_pr,epochs=5,validation_data=ds_val_pr,callbacks=[callback])# plot history

def plot_gph(hist,string):
  plt.plot(hist.history[string])
  plt.plot(hist.history['val_'+string])
  plt.xlabel('epochs')
  plt.ylabel(string)
  plt.legend([string,'val_'+string])
  plt.show()

plot_gph(hist,'accuracy')
plot_gph(hist,'loss')model.compile(optimizer=RMSprop(learning_rate=0.001),loss='sparse_categorical_crossentropy',metrics=['accuracy'])