Skip to content

WASM -> TypeError: Cannot read property 'cwrap' of undefined #3864

@sbstcano

Description

@sbstcano

Hi,
I'm trying to use wasm with facemesh but keep getting this when trying to set wasm as backend.
I'm using version 2.3.0. And it's an Angular 9 project.

import * as tf from '@tensorflow/tfjs-core'
import * as facemesh from '@tensorflow-models/facemesh'
import {setWasmPath} from "@tensorflow/tfjs-backend-wasm"

setWasmPath(`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@2.3.0/dist/tfjs-backend-wasm.wasm`)

tf.setBackend('wasm')
TypeError: Cannot read property 'cwrap' of undefined
    at Object.setupFunc (tf-backend-wasm.esm.js:17)
    at engine.js:161
    at Array.forEach (<anonymous>)
    at Engine.setupRegisteredKernels (engine.js:159)
    at Engine.setBackend (engine.js:152)
    at Module.setBackend (globals.js:258)
    at Module../src/app/enrollment/enrollment.component.ts (enrollment.component.ts:20)
    at __webpack_require__ (bootstrap:79)
    at Module../src/app/app-routing.module.ts (main.js:450)
    at __webpack_require__ (bootstrap:79)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions