[英]Cannot find `protoc` command
When I run this:当我运行这个:
protoc --python_out=. .\object_detection\protos\anchor_generator.proto
on a tensorflow object detection file on the command line, I get:在命令行上的 tensorflow 对象检测文件上,我得到:
'protoc' is not recognized as an internal or external command, operable program or batch file.
I followed all instructions in protoc object_detection/protos/*.proto: No such file or directory , but they never worked for me我按照protoc object_detection/protos/*.proto: No such file or directory 中的所有说明进行操作,但它们从来没有为我工作过
In addition to the searches I made, I tried this command:除了我进行的搜索之外,我还尝试了以下命令:
py-3.6 -m pip install protobuf
and it works for me.它对我有用。
I typed the command again我再次输入命令
python_out=. .\object_detection\protos\anchor_generator.proto
But it still fails and this:但它仍然失败,这是:
C:\Users\laptop market\Downloads\bin\protoc object_detection/protos/*.proto --py_out=.
also fails.也失败了。
You need to save the protoc.exe
file which is located in the zip file to C:\\Users\\Satyarth\\AppData\\Local\\Programs\\Python\\Python36\\Scripts
.您需要将 zip 文件中的
protoc.exe
文件保存到C:\\Users\\Satyarth\\AppData\\Local\\Programs\\Python\\Python36\\Scripts
。
Replace "Satyarth" from the path with your username.用您的用户名替换路径中的“Satyarth”。
If it still isn't working, put the above path in the environment variables.如果还是不行,把上面的路径放到环境变量中。
The way I solved the issue on Windows 10 was to我在 Windows 10 上解决这个问题的方法是
Go to this page to find the downloadable files for the latest version of Protobuf: https://www.github.com/google/protobuf/releases/latest转到此页面查找最新版 Protobuf 的可下载文件: https ://www.github.com/google/protobuf/releases/latest
Then, just download the zip file beginning with protoc
for your OS.然后,只需为您的操作系统下载以
protoc
开头的 zip 文件。
Next, extract it, and you will get a protoc
application.接下来,将其解压缩,您将获得一个
protoc
应用程序。
Finally, you can place it on your local machine.最后,您可以将其放置在本地计算机上。
First, make sure that you have protobuf >=3 installed on your system.首先,确保您的系统上安装了 protobuf >=3。
On Windos protobuf is usually installed through your Python package manager, eg conda or pip, and should already be in your environment.在 Windos 上,protobuf 通常通过您的 Python 包管理器安装,例如 conda 或 pip,并且应该已经在您的环境中。 You can check if it is installed with either
conda list
or pip freeze
.您可以检查它是否安装了
conda list
或pip freeze
。
If it is not installed, simply run如果未安装,只需运行
conda install protobuf
or pip install protobuf
conda install protobuf
或pip install protobuf
.zip
from https://github.com/protocolbuffers/protobuf/releases , make sure you're getting the correct file for your OS..zip
,请确保您获得了适用于您的操作系统的正确文件。protoc.exe
, so in my case C:\\Program Files\\GoogleProtobuf\\bin
protoc.exe
的文件夹,因此在我的情况下为C:\\Program Files\\GoogleProtobuf\\bin
That got it working for me.这让它为我工作。
I also encountered this error a while ago To go around this: Follow the steps listed below:我不久前也遇到了这个错误要解决这个问题:请按照下面列出的步骤操作:
Install the protoc which is applicable for your operating system from this github repo for me it was从这个github repo为我安装适用于您的操作系统的protoc
protoc-3.13.0-win64.zip
Extract the zip file and put it in a folder where it will be permanently there解压缩 zip 文件并将其放入一个永久存在的文件夹中
Go to the bin folder present in the protocFolder in my case I had to go to在我的情况下,转到 protocFolder 中的bin文件夹,我必须转到
F:\\Programing_stuff\\ML\\protoc-3.17.3-win64\\bin or just find where the protoc.exe
file is and copy the path F:\\Programing_stuff\\ML\\protoc-3.17.3-win64\\bin或者直接找到
protoc.exe
文件所在的protoc.exe
并复制路径
Then in the windows search bar type path
and click on Edit the system environment variables
然后在windows搜索栏中输入
path
并点击Edit the system environment variables
And the path of the bin folder和bin文件夹的路径
Hope this helps, If doesn't check this video Or this website (If you want to install TensorFlow)希望这会有所帮助,如果不检查此视频或此网站(如果您想安装 TensorFlow)
First of all consider installing Protobuf Compiler
inside the C:\\Program Files folder.首先考虑在C:\\Program Files 文件夹中安装
Protobuf Compiler
。 Then you need to compile protobuf
every time you want to use Tensorflow Object Detection API.那么每次要使用Tensorflow Object Detection API时都需要编译
protobuf
。 To do this, open cmd in the ../models/research
directory and run为此,请在
../models/research
目录中打开cmd并运行
“C:\\Program Files\\protoc-<PROTO_VERSION>\\bin\\protoc.exe” object_detection/protos/*.proto --python_out=.
where <PROTO_VERSION>
is the version of protobuf compiler, you're using (for example protoc-3.5.1-win64
or the name of the folder you've picked for the protobuf).其中
<PROTO_VERSION>
是您正在使用的 protobuf 编译器的版本(例如protoc-3.5.1-win64
或您为 protobuf 选择的文件夹的名称)。
Be advised, that you should compile protobuf in the every cmd window that is launched to work with Object Detection.请注意,您应该在启动以使用对象检测的每个cmd窗口中编译 protobuf。
My solution for windows:我的 Windows 解决方案:
protoc object_detection/protos/*.proto --python_out=.
protoc object_detection/protos/*.proto --python_out=.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.