infinitered/nsfwjs

Local model import not implemented

DoormatIka opened this issue · 2 comments

I'd like to load a model from disk with this code:

const url = "file:///Users/Thaddea/Documents/vslily/Programming/js/kogachan/data/models/";
const model = await nsfw.load(url, { size: 299, });

but it throws:

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11118:11) {
  cause: Error: not implemented... yet...
      at makeNetworkError (node:internal/deps/undici/undici:9273:35)
      at schemeFetch (node:internal/deps/undici/undici:10603:18)
      at node:internal/deps/undici/undici:10483:26
      at mainFetch (node:internal/deps/undici/undici:10500:11)
      at fetching (node:internal/deps/undici/undici:10457:7)
      at Agent.fetch2 (node:internal/deps/undici/undici:10337:20)
      at Object.fetch (node:internal/deps/undici/undici:11116:28)
      at fetch (node:internal/process/pre_execution:216:25)
      at HTTPRequest.PlatformNode.fetch (C:\Users\Thaddea\Documents\vslily\Programming\js\kogachan\tfjs-core\src\platforms\platform_node.ts:55:27)
      at HTTPRequest.<anonymous> (C:\Users\Thaddea\Documents\vslily\Programming\js\kogachan\tfjs-core\src\io\http.ts:142:43) {
    [cause]: undefined
  }
}

I just had to put "model.json" at the end of the url.

OH glad you got it!