ML5 model train error

39 views
Skip to first unread message

Khurram Mughal

unread,
Jan 23, 2021, 6:56:15 AM1/23/21
to TensorFlow.js Discussion
Hi there

I am watching a video on you tube to build a model to detect square , circle and triangle.

I am using P5JS for front end and generated 100 images for each shape with following specs

Height:64 
Width: 64
File type: PNG

I am using ML5 for my ease.

When I train the model I am getting following error



tf-core.esm.js:17 Uncaught Error: Based on the provided shape, [30,64,64,4], the tensor should have 491520 values but has 120
    at C (tf-core.esm.js:17)
    at Pn (tf-core.esm.js:17)
    at Object.jn (tf-core.esm.js:17)
    at NeuralNetworkData.js:300
    at tf-core.esm.js:17
    at t.scopedRun (tf-core.esm.js:17)
    at t.tidy (tf-core.esm.js:17)
    at Object.rn (tf-core.esm.js:17)
    at t.value (NeuralNetworkData.js:276)
    at t.value (index.js:376)

To ml5 I am passing following options

  const options = {
    task: "imageClassification",
    inputs:[IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_CHANNELS],
    debug: true
    //outputs: ['label']
  };

IMAGE_WIDTH  = 64 , IMAGE_HEIGHT = 64 and IMAGE_CHANNEL = 4 
as per ml5 docs


I am passing 10 images of each shape as input. I know I have to speak with ml5 about this but was wondering if anyone can help me because I can see that it might be tensor shape error which you guys can assist me as well.

Regards


Reply all
Reply to author
Forward
0 new messages