1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ml5.jsのSoundClassifier呼び出しエラー対処メモ

Posted at

ml5.jsのSoundClassifier呼び出しエラー

SoundClassifierを使おうとしているが、Javascriptのエラー。。
よく分からないので知見を持っている方に伺いました。

MicrosoftTeams-image.png

ソースの修正点

エラーのソースと正しいソース両方のせましたが、引数のvideoがいらなかったです。
ImageClassifierのソースをコピーして使いまわして実施していたので、取っていなかったことが原因でした。

エラーのソース

// 自作モデルのロード
classifier = ml5.soundClassifier(imageModelURL + 'model.json', video, () => {
  // ロード完了
  app.modelState = 'ロード完了!';
  console.log('Model Loaded!');
});

正しいのソース

// 自作モデルのロード
classifier = ml5.soundClassifier(imageModelURL + 'model.json', () => {
  // ロード完了
  app.modelState = 'ロード完了!';
  console.log('Model Loaded!');
});

最後に

SoundClassifierの下記の仕様ちゃんと読んでつかわないといけなかったな。。
https://learn.ml5js.org/#/reference/sound-classifier

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?