My kernel keeps dying in jupyter notebook when i run fit function

Viewed 70

My kernel keeps dying when i run fit function my tensorflow version 2.6.0

i've reinstalled the jupyter notebook, upgraded my pip, upgraded my tensoflow library, added this line

import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'

and still my kernel keeps dying

this is the code i tried to run

learning_rate_reduction = ReduceLROnPlateau(monitor = 'val_acc', patience = 3, verbose = 1, factor = .5, min_lr = .00001)

es = EarlyStopping(monitor='val_categorical_accuracy', patience = 4)

print('====')

history = model.fit_generator(generator = train_batches, steps_per_epoch = train_batches.n//batch_size, epochs=epochs, 
                    validation_data = val_batches, validation_steps = val_batches.n//batch_size, verbose = 0,
                    callbacks = [learning_rate_reduction, es])
2 Answers

In my experience you should try one of these

  1. Check Environment Variables

    • make sure you have CUDA_PATH
    • make sure you write path to cuda/bin, cuda/include, cuda/lib/x64 in PATH in System Variables
  2. Check if the model is too complex by training the network on smaller simpler model

  3. Make sure anaconda navigator is updated

  4. In my experience python 3.8.5 and tensorflow 2.7 works and can be downloaded in the environments in anaconda navigator

If it broke with simple model, it means you're doing something wrong with the PATH in system environment If you're using VSCode you might have to set all the variables first before using If you're using Anaconda you can download directly in download section im using tensorflow 2.8 and python 3.10 and still works

Related