简体   繁体   English

无法使用 pip 安装 Openvino

[英]Cannot install Openvino with pip

I'm trying to install Openvino to convert a Keras model into a representation for the inference engine.我正在尝试安装 Openvino 以将 Keras model 转换为推理引擎的表示形式。 I'm running the command:我正在运行命令:

python3 openvino/tools/mo/mo_tf.py —model_13.h5/ --input_shape=\[180,180\]

This returns the error:这将返回错误:

from openvino.tools.mo.subprocess_main import subprocess_main
ModuleNotFoundError: No module named 'openvino'

I've tried pip install openvino but consistently get:我试过pip install openvino但一直得到:

ERROR: Could not find a version that satisfies the requirement openvino (from versions: none)
ERROR: No matching distribution found for openvino

To try and make sure the versions of python for running the script and installing Openvino are the same, I've tried:为了尝试确保运行脚本和安装 Openvino 的 python 版本相同,我尝试过:

python3 -m pip install openvino

The content of the mo_tf.py script is simply: mo_tf.py 脚本的内容很简单:

#!/usr/bin/env python3

# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0


if __name__ == "__main__":
    from openvino.tools.mo.subprocess_main import subprocess_main
    subprocess_main(framework='tf')

Has anyone seen this issue and found a workaround?有没有人看到这个问题并找到解决方法?

The latest version of openvino is 2021.4.2. openvino 的最新版本是 2021.4.2。 The list of packages to download by pip includes packages for Python 3.6-3.9 for Linux, MacOS on Intel, and Windows; The list of packages to download by pip includes packages for Python 3.6-3.9 for Linux, MacOS on Intel, and Windows; only packages for 64-bit platforms are provided.仅提供 64 位平台的软件包。 No packages for Python 3.10 and no source code. Python 3.10 没有包,也没有源代码。

The solution is either to compile from sources , or install with Docker or install from Anaconda .解决方案是 从源代码编译,或使用 Docker 安装或从 Anaconda 安装 Or downgrade to Python 3.9.或者降级到 Python 3.9。

In case anyone is using Mac-M1, This command will solve this issue.如果有人使用 Mac-M1,此命令将解决此问题。

pip install openvino-arm

On a separate note, if you happen to install openvino-dev instead of openvino consider adding quote escape as by default zsh (not bash) interprets square brackets as an expression for pattern matching.另外,如果您碰巧安装openvino-dev而不是openvino ,请考虑添加引号转义,因为默认情况下 zsh(而不是 bash)会将方括号解释为模式匹配的表达式。

To resolve this issue, you need to escape the command with quotes:要解决此问题,您需要使用引号对命令进行转义:

Use this用这个

pip install 'openvino-dev[tensorflow2,mxnet,caffe]'

Instead of代替

pip install openvino-dev[tensorflow2,mxnet,caffe]

I had same problem.I was not installing it in virtual environment.我有同样的问题。我没有在虚拟环境中安装它。 Try to install it in virtual env it works!尝试将其安装在虚拟环境中,它可以正常工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM