0

我正在尝试为 tfjs-node 的图像中的文本检测实现EAST模型。我下载了原始的冻结模型,使用它进行转换tensorflowjs_converter,然后使用以下代码加载模型:

import * as tf from '@tensorflow/tfjs-node'
import fs from 'fs'

const handler = tf.io.fileSystem('/path/to/model')
const model await tf.loadGraphModel(handler)
const imageBuffer = fs.readFileSync('/path/to/image')
const tensor = tf.node.decodeImage(imageBuffer, 3)
    .expandDims(0)
    .toFloat()
const output = await model.executeAsnyc(tensor)

由于某种原因,模型的执行失败,我收到以下错误:Error: Error in concat4D: Shape of tensors[1] (1,45,80,512) does not match the shape of the rest (1,46,80,2048) along the non-concatenated axis 1.

我究竟做错了什么?

4

0 回答 0