Skip to content

ConcatOp : Dimensions of inputs should match: shape[0] = [1,40,40,256] vs. shape[1] = [1,38,50,256] #7398

Open
@playground

Description

@playground

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS M1
  • TensorFlow.js installed from (npm or script link): tfjs-node v4.2.0, node v16.17.1

Describe the current behavior
I have a working yolov5 model and exported it to tfjs saved_model. The saved_model loads fine, but throws this error when run predict

let inputTensor = decodedImage.expandDims(0).cast('float32');
let tensor = {};
let tensor['x'] = inputTensor; 
let outputTensor = this.model.predict(tensor);
Error: Session fail to run with error: {{function_node __inference_pruned_8038}} {{function_node __inference_pruned_8038}} ConcatOp : Dimensions of inputs should match: shape[0] = [1,40,40,256] vs. shape[1] = [1,38,50,256]

Other info / logs Include any logs or source code that would be helpful to

Error: Session fail to run with error: {{function_node __inference_pruned_8038}} {{function_node __inference_pruned_8038}} ConcatOp : Dimensions of inputs should match: shape[0] = [1,40,40,256] vs. shape[1] = [1,38,50,256]
         [[{{node model/tf_concat/concat}}]]
         [[PartitionedCall/PartitionedCall/PartitionedCall]]
    at NodeJSKernelBackend.runSavedModel (/myapp/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.js:459:43)
    at TFSavedModel.predict (/myapp/node_modules/@tensorflow/tfjs-node/dist/saved_model.js:364:52)
    at Observable._subscribe (/myapp/dist/common/utils.js:257:47)
    at Observable._trySubscribe (/myapp/node_modules/rxjs/dist/cjs/internal/Observable.js:41:25)
    at /myapp/node_modules/rxjs/dist/cjs/internal/Observable.js:35:31
    at Object.errorContext (/myapp/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9)
    at Observable.subscribe (/myapp/node_modules/rxjs/dist/cjs/internal/Observable.js:26:24)
    at Utils.checkImage (/myapp/dist/common/utils.js:196:26)
    at Timeout._onTimeout (/myapp/dist/common/utils.js:388:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions