擅长:python、mysql、java
<p>Tensorflow.js无法直接访问本地文件(除非您在Node.js中这样做)。请看一些<a href="https://stackoverflow.com/questions/53639919/load-tensorflow-js-model-from-local-file-system-in-javascript">these answers</a></p>
<p>查看<a href="https://js.tensorflow.org/api/latest/#loadLayersModel" rel="nofollow noreferrer">Tensorflow.js API</a>,您的选项似乎是:</p>
<ol>
<li>从HTTP服务器加载模型</li>
<li>从<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file" rel="nofollow noreferrer">HTML file input
elements</a>中的用户选定文件加载模型</李>
</ol>