- TensorFlow Lite移动端深度学习
- 朱元涛编著
- 232字
- 2025-02-26 05:52:54
2.2.3 安装TensorFlow Lite解释器
如果想要使用Python快速运行TensorFlow Lite模型,需要安装TensorFlow Lite解释器,而无须安装本书2.2.1和2.2.2节中介绍的所有TensorFlow软件包。
只包含TensorFlow Lite解释器的软件包是完整TensorFlow软件包的一小部分,其中只包含使用TensorFlow Lite运行所需要的最少代码(仅包含Python类tf.lite.Interpreter)。如果只想执行.tflite模型,而不希望庞大的TensorFlow库占用磁盘空间,那么只安装这个小软件包是最理想的选择。
注意:如果需要访问其他Python API(如TensorFlow Lite转换器),则必须安装完整的TensorFlow软件包。
在计算机中可以使用pip install命令安装TensorFlow Lite,假如读者的Python版本是3.9,则可以使用以下命令安装TensorFlow Lite。
