-
Notifications
You must be signed in to change notification settings - Fork 42
[example]Add new super-resolution model from OpenVINO model zoo #1245
Comments
I fixed the problem that relu with multiple outputs may caused the following ops can't find corresponding input tensor. Relu needs to be executed seperately and there are continuous relu in this model. |
@huningxin Do you have any suggestions in this problem? |
@huningxin Any suggestions? |
Generally WebNN uses channel-last layout, OpenVINO uses channel-first layout. Could you please share what are the shapes (convolution, reshape, permute) when you run it with webml-polyfill? |
Is this figure just for openvino model? I suppose WebNN uses NHWC layout, e.g. so the shape of Convolution should be |
|
Did you try to permute |
Yes,I tried to permute |
I replace rehspape->permute->reshape with depthToSpace op: case 'Reshape': {
let nextNode = graph.nodes[i + 1];
let next2Node = graph.nodes[i + 3];
if(nextNode && next2Node && nextNode.operator === 'Permute' &&
next2Node.operator === 'Reshape' )
{
const input = node.inputs[0];
console.log(`input shape: [${input.shape()}]`);
const blockSize = node.outputs[0].shape()[4];
inputs.push(this._getTensorId(input));
inputs.push(this._addScalarInt32(blockSize));
console.log(`blockSize ${blockSize}`);
const output = next2Node.outputs[0];
// Add outputs
const outDims = output.shape();
const outputType = {
type: this._getTypeCode(output.dataType()), dimensions: outDims
};
const outputId = this._addNamedOperand(output.graphId(), outputType);
outputs.push(outputId);
console.log(` output shape: [${outDims}]`);
i += 3;
console.log('Merge Reshape->Permute->Reshape into depthToSpace');
opCode = this._nn.DEPTH_TO_SPACE;
} This can bypass the processing of 6D tensor but still can not get the correct result,
|
Add new super-resolution model from openvino.
Here is the corresponding information of the model :
These two models can be run in OpenVINO and the performance of these two models is
I tried to run these two models in polyfill, but I encountered the following problems during the model compilation stage:
The reason is that the Tensor corresponding to the input cannot be found in the .bin file when analysing the eltwise operation . This problem can be reproduced in this repo.
I only made small changes to
OpenVINOModelImporter.js
and the problem seems to be in the weight file or whenOpenVINOModelImporter.js
calling the_addTensorOperands
function the corresponding Tensor was not resolved . Currently I can't locate the problem.I encountered this error in eltwise operation in both models,corresponding to the operation of name = "39" and the operation of name = "37" respectively.
The text was updated successfully, but these errors were encountered: