Course 3 Week 3 assignment create_model

I’m getting an error that I do not understand with the create model step. Here is the error message. Can you point me in the right direction?

ValueError Traceback (most recent call last)
in
5
6 # Train the model and save the training history
----> 7 history = model.fit(train_pad_trunc_seq, train_labels, epochs=20, validation_data=(val_pad_trunc_seq, val_labels))

/opt/conda/lib/python3.8/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

/opt/conda/lib/python3.8/site-packages/keras/engine/data_adapter.py in select_data_adapter(x, y)
986 if not adapter_cls:
987 # TODO(scottzhu): This should be a less implementation-specific error.
→ 988 raise ValueError(
989 "Failed to find data adapter that can handle "
990 “input: {}, {}”.format(

ValueError: Failed to find data adapter that can handle input: <class ‘numpy.ndarray’>, (<class ‘tuple’> containing values of types {“<class ‘int’>”})

I have not taken that class, so I know nothing about the details of that assignment. But just looking at the error message, my guess would be that it does not like the types of either your training data or the validation data that you have fed to the “fit()” method there. It seems to be saying that it’s a tuple (which looks ok to me at least for validation_data based on this document), but I think it wants the elements of the tuple to be numpy arrays or TF tensors. My interpretation of the message is that it’s telling you the elements of the tuple are scalar python integers, not arrays or tensors.

I’d start the debugging process by printing the types of all the data inputs there.

Hello!
@George_Paslaski If you’re still facing any issues and need assistance, please feel free to share your notebook with me for analysis. Then, we can discuss the problem in more detail here. Just click on my name and add your notebook.

Evidently the solution to the problem was to close out the notebook and re run all the code with no changes. :slight_smile: The code is working now. Have a great day! George