Local model import not implemented #738
Replies: 3 comments
-
I just had to put "model.json" at the end of the url. |
Beta Was this translation helpful? Give feedback.
-
OH glad you got it! |
Beta Was this translation helpful? Give feedback.
-
I'm trying to deploy something via docker and getting this error. When using Node.js 20, exactly the error from the original post is thrown, since However, when passing
The latter URL is created by using Node's url module: import * as path from "node:path";
import { pathToFileURL } from "node:url";
const modelPath = path.join(config.modelDir, "model.json");
const modelUrl = pathToFileURL(modelPath);
console.log(modelUrl.toString()); Normal paths are not supported, which seems to be a design decision:
Any chance to load the files from disk? Edit: const model = new NSFWJS(tf.io.fileSystem("/model/model.json"), {
size: 224,
type: "graph",
});
await model.load(); Results in:
When omitting
|
Beta Was this translation helpful? Give feedback.
-
I'd like to load a model from disk with this code:
but it throws:
Beta Was this translation helpful? Give feedback.
All reactions