簡體   English   中英

無法導入 tflite-support 包。 接收錯誤“DLL 加載失敗:找不到指定的模塊”

[英]Unable to Import tflite-support package. Receiving error "DLL load failed: The specified module could not be found"

我一直在嘗試在我的 Anaconda 環境中安裝 tflite-support 包。 這些是我遵循的步驟:

  • 使用conda create --name test_env python==3.7創建了一個新的 python 環境
  • 使用 conda conda install tensorflow (因為 pip install 在我的 PC 上出現導入錯誤)
  • 然后使用pip install tflite-support包(conda install 拋出 PackagesNotFoundError 錯誤)

以下代碼片段可用於重現錯誤:

import tensorflow as tf
from tflite_support import flatbuffers
from tflite_support import metadata as _metadata
from tflite_support import metadata_schema_py_generated as _metadata_fb

這會引發以下錯誤:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-37cdba048740> in <module>
----> 1 from tflite_support import flatbuffers
      2 from tflite_support import metadata as _metadata
      3 from tflite_support import metadata_schema_py_generated as _metadata_fb

c:\programdata\anaconda3\envs\testx\lib\site-packages\tflite_support\__init__.py in <module>
     28 
     29 import flatbuffers as _flatbuffers
---> 30 from tensorflow_lite_support.metadata import metadata as _metadata
     31 from tensorflow_lite_support.metadata import metadata_schema_py_generated as _metadata_schema_py_generated
     32 from tensorflow_lite_support.metadata import schema_py_generated as _schema_py_generated

c:\programdata\anaconda3\envs\testx\lib\site-packages\tensorflow_lite_support\metadata\metadata.py in <module>
     32 from tensorflow_lite_support.metadata import metadata_schema_py_generated as _metadata_fb
     33 from tensorflow_lite_support.metadata import schema_py_generated as _schema_fb
---> 34 from tensorflow_lite_support.metadata.cc.python import _pywrap_metadata_version
     35 from tensorflow_lite_support.metadata.flatbuffers_lib import _pywrap_flatbuffers
     36 

ImportError: DLL load failed: The specified module could not be found.

我嘗試過不同版本的 python、tensorflow 和 tflite-support,但每次都遇到相同的錯誤。 提前致謝!

我和你做的完全一樣,但我沒有提到任何 Python 版本,它對我來說很好用。

我的python版本是3.8.5

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM