Skip to content

tfjs.node.decodeImage run error in workthread #7064

Open
@mccoysc

Description

@mccoysc

System information
any system,any node version 18.×

Describe the current behavior
in nodejs workThread:

ctx={tfjsnode:function(){return require("@tensorflow/tfjs-node")}};

code="imgData=fs.readFileSync("img.jpg");imgData=Uint8Array.from(imgData);tfjsnode().node.decodeImage(imgData)";

vm.runInNewContext(ctx,code);

the code would throw an error: decodeImage can only accept typedArray and so on.

i traced it into code and found:
isTypedArray(values) would always return false.
but really,values is a Uint8Array.

i don't know why.

Describe the expected behavior

Standalone code to reproduce the issue

Other info / logs

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions