diff --git a/lenet/lenet.js b/lenet/lenet.js index 45d85f19..fb5f1afc 100644 --- a/lenet/lenet.js +++ b/lenet/lenet.js @@ -22,7 +22,10 @@ export class LeNet { throw new Error('Incorrect weights file'); } - this.context_ = await navigator.ml.createContext(contextOptions); + let adapter = await navigator.gpu.requestAdapter(); + let device = await adapter.requestDevice(); + + this.context_ = await navigator.ml.createContext(device); this.builder_ = new MLGraphBuilder(this.context_); const inputShape = /* nchw */ [1, 1, 28, 28]; let input = this.builder_.input('input', {