Bonjour à tous,

Je suis en train d'entrainer une IA mais j'ai un message d'erreur concernant le nombre d'époches et de batch. Du coup, j'ai ajouté la fonction repeat() mais ça ne fonctionne toujours pas et l'apprentissage arrive à cours de données. Si vous avez déjà été confronté à ce genre de problème ou si vous avez une idée de comment générer des datas infinies ça m'aiderait pas mal parce que là je bloque

Voici le code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
 
BATCH_SIZE = 500
coeff=0.2
N_VALIDATION = int(coeff*len(df))
N_TRAIN = int((1-coeff)*len(df))
BUFFER_SIZE= N_TRAIN
STEPS_PER_EPOCH = 1 #int(N_TRAIN//BATCH_SIZE)
 
inputs, labels=split_window(df)
 
ds=tf.data.Dataset.from_tensor_slices((inputs, labels))
packed_ds=ds.shuffle(BUFFER_SIZE).repeat(3).batch(BATCH_SIZE, drop_remainder=True)#.prefetch(tf.data.AUTOTUNE)
 
validate_ds = packed_ds.take(N_VALIDATION).cache()
train_ds = packed_ds.skip(N_VALIDATION).take(N_TRAIN).cache()
 
def compile_and_fit(model, name, optimizer=None, max_epochs=1000):
  if optimizer is None:
    optimizer = get_optimizer()
  model.compile(optimizer=optimizer,
                loss=tf.keras.losses.BinaryCrossentropy(from_logits=True),
                metrics=[
                  tf.keras.losses.BinaryCrossentropy(
                      from_logits=True, name='binary_crossentropy'),
                  'accuracy'])
 
  history = model.fit(
    train_ds,
    steps_per_epoch = STEPS_PER_EPOCH,
    epochs=max_epochs,
    validation_data=validate_ds,
    callbacks=get_callbacks(name),
    verbose=0)
 
  model.summary()
 
  return history
Et voici le message d'erreur:

0
Input shape: (1462161, 30, 1)
Target shape: (1462161, 30, 1)
0
2022-08-11 03:58:06.466184: E tensorflow/core/profiler/internal/gpu/cupti_tracer.cc:1666] function cupti_interface_->Subscribe( &subscriber_, (CUpti_CallbackFunc)ApiCallback, this)failed with error CUPTI could not be loaded or symbol could not be found.
2022-08-11 03:58:06.811542: E tensorflow/core/profiler/internal/gpu/cupti_tracer.cc:1757] function cupti_interface_->Finalize()failed with error CUPTI could not be loaded or symbol could not be found.
WARNING:tensorflow:Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least `steps_per_epoch * epochs` batches (in this case, 1000 batches). You may need to use the repeat() function when building your dataset.
Expect x to be a non-empty array or dataset.
Merci d'avance,

Mango1