Uncaught (in promise) Error: Based on the provided shape, [1,1,16,32], the tensor should have 512 values but has 52

89 Views Asked by At

I am trying to build a face expression recognition app with face api and reactjs. On locally the app is working fine. but when i deploy to github pages i am getting the below error

enter image description here

when i use serve -s build on my local machine, i am getting this error

enter image description here

This is my code to load the models,

  const loadModels = useCallback(() => {
     Promise.all([
      faceapi.nets.tinyFaceDetector.loadFromUri("/models"),
      faceapi.nets.faceLandmark68Net.loadFromUri("/models"),
      faceapi.nets.faceRecognitionNet.loadFromUri("/models"),
      faceapi.nets.faceExpressionNet.loadFromUri("/models"),
     ]).then(() => {
    faceDetection();
   });
  },[]);

  useEffect(() => {
    startVideo();
    videoRef && loadModels();
  }, [loadModels]);

Got any idea why this is happening?

0

There are 0 best solutions below