+ 1

i have a problem while training my deep learning model

hi everyone , i'm working on deep learning model to predict if images if they contain dog or cat , but when i try to train the model i get this error : (can anyone please help me to fix the problem ?) InvalidArgumentError Traceback (most recent call last) c:\Users\jebalia\Vs-Data-workplace\Project\cat-dog\DogsVsCats (no-transfer-learning).ipynb Cellule 27 in <cell line: 1>() 1 with tf.device('/device:GPU:0') : 2 epochs = 40 ----> 3 history = korobka.fit(train_generator, 4 validation_data = validation_generator, 5 epochs=epochs, 6 validation_steps= len(val_set) // batch_size, 7 steps_per_epoch= len(train_set)// batch_size, 8 callbacks= [early_stopping] 9 ) File c:\Users\jebalia\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\utils\traceback_utils.py:67, in filter_traceback.<locals>.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 c:\Users\jebalia\AppData\Local\Programs\Python\Python310\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) ... File "c:\Users\jebalia\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\layers\preprocessing\image_preprocessing.py", line 416, in _batch_augment return self._map_fn(self._augment, inputs) Node: 'sequential_1/sequential/random_flip/map/TensorArrayUnstack/TensorListFromTensor' Specified a list w

9th Sep 2022, 2:43 PM
Ramzi Jebalia
Ramzi Jebalia - avatar
2 Respuestas
+ 3
I am not sure but I think you need to reshape the data. See this line in your error (your above comment) " TensorListFromTensor Specified a list with shape [244,244,3] from a tensor with shape [224,224,3] "
9th Sep 2022, 3:43 PM
Sandeep
Sandeep - avatar
0
the rest of the error : File "c:\Users\jebalia\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\layers\preprocessing\image_preprocessing.py", line 416, in _batch_augment return self._map_fn(self._augment, inputs) Node: 'sequential_1/sequential/random_flip/map/TensorArrayUnstack/TensorListFromTensor' Specified a list with shape [244,244,3] from a tensor with shape [224,224,3] [[{{node sequential_1/sequential/random_flip/map/TensorArrayUnstack/TensorListFromTensor}}]] [Op:__inference_train_function_2542]
9th Sep 2022, 2:45 PM
Ramzi Jebalia
Ramzi Jebalia - avatar