Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error: No backend found in registry" when trying to load in Web Worker. #118

Open
ScottDellinger opened this issue Oct 28, 2018 · 0 comments

Comments

@ScottDellinger
Copy link

I'm still trying to mitigate the "warm up" time that locks the browser interface by loading it in a Web Worker. I've gotten it fairly far but have bumped into an error.

"Error: No backend found in registry". This happens when attempting to load the libraries. It appears both attempts to register a backend fail.

Here's from my console (Firefox):

Error: WebGL warning: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. tf-core.esm.js:17:45101
Registration of backend webgl failed face-api.js:23:50055
e@http://192.168.0.15/Scripts/face-api.js:23:212026
@http://192.168.0.15/Scripts/face-api.js:23:248669
Environment</e.prototype.registerBackend@http://192.168.0.15/Scripts/face-api.js:23:49917
@http://192.168.0.15/Scripts/face-api.js:23:248623
@http://192.168.0.15/Scripts/face-api.js:4:6
@http://192.168.0.15/Scripts/face-api.js:1:2
@http://192.168.0.15/Scripts/v2/FacialComparison/Worker.js:3:1
face-api.js:23:50108
Registration of backend cpu failed face-api.js:23:50055
e@http://192.168.0.15/Scripts/face-api.js:23:315878
@http://192.168.0.15/Scripts/face-api.js:23:353885
Environment</e.prototype.registerBackend@http://192.168.0.15/Scripts/face-api.js:23:49917
@http://192.168.0.15/Scripts/face-api.js:23:353841
@http://192.168.0.15/Scripts/face-api.js:4:6
@http://192.168.0.15/Scripts/face-api.js:1:2
@http://192.168.0.15/Scripts/v2/FacialComparison/Worker.js:3:1
Error: No backend found in registry.

And here's the code from my Web Worker:

let window = self;
importScripts('/Scripts/v2/FacialComparison/setImmediate.js');
importScripts('/Scripts/face-api.js');
(function () {
    send = function (e) {
        // Send something to the main thread
        postMessage(e);
        // Close the worker gracefully, letting it clean up 
        // after itself
        self.close();
    };

    LoadLibraries();
})();

async function LoadLibraries() {
    // load FaceAPI libraries
    try {
        console.log("Loading libraries...");
        await faceapi.loadTinyFaceDetectorModel('/Content/FaceAPIModels');
        await faceapi.loadFaceLandmarkModel('/Content/FaceAPIModels');
        await faceapi.loadFaceRecognitionModel('/Content/FaceAPIModels');
        console.log("Libraries loaded.");
    }
    catch (ex) {
        console.log(ex);
    }
}

Any ideas or suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant