C1w4 : error on model training

i am getting the model summary in console log, but on the fit method some errors are coming

__________________________________________________________________________________________ tfjs@latest:17:574250
Layer (type)                Input Shape               Output shape              Param #   tfjs@latest:17:575422
========================================================================================== tfjs@latest:17:574277
flatten_Flatten4 (Flatten)  [[null,7,7,1024]]         [null,50176]              0         tfjs@latest:17:575422
__________________________________________________________________________________________ tfjs@latest:17:574364
dense_Dense7 (Dense)        [[null,50176]]            [null,100]                5017700   tfjs@latest:17:575422
__________________________________________________________________________________________ tfjs@latest:17:574364
dense_Dense8 (Dense)        [[null,100]]              [null,5]                  505       tfjs@latest:17:575422
========================================================================================== tfjs@latest:17:574364
Total params: 5018205 tfjs@latest:17:574482
Trainable params: 5018205 tfjs@latest:17:574513
Non-trainable params: 0 tfjs@latest:17:574547
__________________________________________________________________________________________ 

this is the error i am getting after model summary

tfjs@latest:17:574585
Uncaught (in promise) TypeError: e is null
    r https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    phe https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    value https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    e https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    h https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    w https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    x https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    u https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    o https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    c https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    c https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    value https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    e https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    h https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    w https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    x https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    u https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    o https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    c https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    c https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    value https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    e https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    h https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    w https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    x https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    u https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    o https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    c https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    c https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    value https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    train http://localhost:5001/C1_W4_Assignment.js:63
    doTraining http://localhost:5001/C1_W4_Assignment.js:152
    onclick http://localhost:5001/rpsls.html:1

this is the 63rd line in C1_W4_Assignment.js

  model.summary();
  let loss = 0;
  model.fit(dataset.xs, dataset.ys, {  /// 63rd line
    epochs: 10,
    callbacks: {
      onBatchEnd: async (batch, logs) => {
        loss = logs.loss.toFixed(5);
        console.log('LOSS: ' + loss);
      }
    }
  });

i am getting a window indicating model training got completed, but the training is not staring on checking the console

I suppose the model summary code was already given and not written by you right?

No, I wrote it myself to check for any issues with the model.
I think the issue might be with the data since I’m getting this on adding samples.

Uncaught Error: Error when checking : expected input_1 to have shape [null,224,224,3] but got array with shape [1,240,240,3].
    r https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    w https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    n https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    dhe https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    value https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    handleButton http://localhost:5001/C1_W4_Assignment.js:106
    onclick http://localhost:5001/rpsls.html:1
10 tfjs@latest:17:10422
    construct self-hosted:2307
    r https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    construct self-hosted:2307
    w https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    n https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    dhe https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    value https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest:17
    handleButton http://localhost:5001/C1_W4_Assignment.js:106
    onclick http://localhost:5001/rpsls.html:1

can you rather share screenshot of the console images you shared here.

on adding samples

on model training

can you confirm if you have not left any similar files in the same folder of assignment notebook you are working??

Here is what I did when I had a not so similar issue. Deleted all the files I downloaded, then re-download, and wrote codes only where it was mentioned to write the code, perse write code only where it mentioned ###YOUR CODE HERE AND END YOUR CODE HERE###

especially check the dataset xs which I suppose you have written correctly otherwise you wouldn’t be able to take the images, but it probably has a copy file, which is why it is not taking as null.

Regards
DP