tirthajyoti/Deep-learning-with-Python

HELP: InvalidArgumentError: Graph execution error

TomMoxom opened this issue · 2 comments

Hi, I'm trying to implement your code from your:

Deep-learning-with-Python/Notebooks/Keras_flow_from_directory.ipynb

repo to a different dataset but run into the following error "InvalidArgumentError: Graph execution error" with a load of text afterwards; when trying to fit the model. I've tried a number of things but cant seem to fix it.

The only change I've made is the dataset, which is working and reading fine up to this point. And i've commented out the target_size in the train_generator.

Thanks, Tom

This is the top part of the error:

InvalidArgumentError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_264/102295305.py in
1 n_epochs = 30
2
----> 3 history = model.fit(
4 train_generator,
5 steps_per_epoch=total_sample/batch_size,

~\anaconda3\envs\BigData\lib\site-packages\keras\utils\traceback_utils.py in 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

~\anaconda3\envs\BigData\lib\site-packages\tensorflow\python\eager\execute.py 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:

InvalidArgumentError: Graph execution error:

Detected at node 'categorical_crossentropy/softmax_cross_entropy_with_logits' defined at (most recent call last): ...

What dataset are you using? Is it binary or categorical?