Open ToonTalk opened 4 years ago
Tensorflow.js requires that you specify the protocol when loading a model, so you need to expand that path to the full path of where you are hosting the model file, including http / https
I can see we do introduce this issue in the snippet, will create a ticket for updating the snippet to a path that illustrates it.
Thanks. Just curious why this is required only for the audio example. The same './my_model/metadata.json' works fine for the image and posenet snippets.
Adding in @caisq.
I think this is because of this line in speech commands: throw new Error
We changed how we were handling image and pose metadata checks to account for the case of someone loading a model locally like './my_model/metadata'.
The following occurs with localhost and also at https://ecraft2learn.github.io/ai/teachablemachine/sound/
./my_model/metadata.json is https:// but isn't recognized as such
(index):57 Uncaught (in promise) Error: Unsupported URL scheme in metadata URL: ./my_model/metadata.json. Supported schemes are: http://, https://, and (node.js-only) file:// at speech-commands.min.js:17 at speech-commands.min.js:17 at Object.next (speech-commands.min.js:17) at speech-commands.min.js:17 at new Promise ()
at i (speech-commands.min.js:17)
at speech-commands.min.js:17
at e. (speech-commands.min.js:17)
at speech-commands.min.js:17
at Object.next (speech-commands.min.js:17)