I have created a transfer learning model using Resnet50. I want to perform a K-fold cross-validation on my model after which I want to find the average AUC value and standard deviation. Files.csv contains the name of the image and its corresponding label. However, I am getting an error message while performing the task. I am not sure if this is the correct method or not. Please let me know if there are other better processes. Please find my code in kf. ipynb file.
After running this code, I am getting the following error message:
Found 3076 validated image filenames belonging to 2 classes. Found 769 validated image filenames belonging to 1 classes. Epoch 1/5 --------------------------------------------------------------------------- InvalidArgumentError Traceback (most recent call last) Input In [75], in () 39 callbacks_list = [checkpoint] 40 # There can be other callbacks, but just showing one because it involves the model name 41 # This saves the best model 42 # FIT THE MODEL ---> 43 history = model.fit(train_data_generator, 44 epochs=num_epochs, 45 callbacks=callbacks_list, 46 validation_data=valid_data_generator) 47 #PLOT HISTORY 48 # : 49 # : 50 51 # LOAD BEST MODEL to evaluate the performance of the model 52 model.load_weights("/saved_models/model_"+str(fold_var)+".h5") File ~\anaconda3\lib\site-packages\keras\utils\traceback_utils.py:67, in filter_traceback..error_handler(*args, **kwargs) 65 except Exception as e: # pylint: disable=broad-except 66 filtered_tb = _process_traceback_frames(e.__traceback__) ---> 67 raise e.with_traceback(filtered_tb) from None 68 finally: 69 del filtered_tb File ~\anaconda3\lib\site-packages\tensorflow\python\eager\execute.py:54, in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name) 52 try: 53 ctx.ensure_initialized() ---> 54 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, 55 inputs, attrs, num_outputs) 56 except core._NotOkStatusException as e: