EdjeElectronics / TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

How to train a TensorFlow Object Detection Classifier for multiple object detection on Windows
Apache License 2.0
2.92k stars 1.3k forks source link

protoc: command not found #497

Open aflat00n opened 4 years ago

aflat00n commented 4 years ago

In step 2g, when verifying if tensorflow is working or not, getting this protoc: command not found error

Please have a look anyone, any help or guidance is much appreciated.

When running this:

%%bash cd models/research/ protoc object_detection/protos/*.proto --python_out=.

Then getting this:

/usr/bin/bash: line 2: protoc: command not found

CalledProcessError Traceback (most recent call last)

in ----> 1 get_ipython().run_cell_magic('bash', '', 'cd models/research/\nprotoc object_detection/protos/*.proto --python_out=.\n') i:\anaconda3\envs\tensorflow1\lib\site-packages\IPython\core\interactiveshell.py in run_cell_magic(self, magic_name, line, cell) 2357 with self.builtin_trap: 2358 args = (magic_arg_s, cell) -> 2359 result = fn(*args, **kwargs) 2360 return result 2361 i:\anaconda3\envs\tensorflow1\lib\site-packages\IPython\core\magics\script.py in named_script_magic(line, cell) 140 else: 141 line = script --> 142 return self.shebang(line, cell) 143 144 # write a basic docstring: in shebang(self, line, cell) i:\anaconda3\envs\tensorflow1\lib\site-packages\IPython\core\magic.py in (f, *a, **k) 185 # but it's overkill for just that one bit of state. 186 def magic_deco(arg): --> 187 call = lambda f, *a, **k: f(*a, **k) 188 189 if callable(arg): i:\anaconda3\envs\tensorflow1\lib\site-packages\IPython\core\magics\script.py in shebang(self, line, cell) 243 sys.stderr.flush() 244 if args.raise_error and p.returncode!=0: --> 245 raise CalledProcessError(p.returncode, cell, output=out, stderr=err) 246 247 def _run_script(self, p, cell, to_close): CalledProcessError: Command 'b'cd models/research/\nprotoc object_detection/protos/*.proto --python_out=.\n'' returned non-zero exit status 127
spranjal25 commented 4 years ago

Could you mention what OS you're using and also the Python path from your system?

as I say "I:\" in your logs, I'll assume you're using some windows version? (if not let me know)

All you need to do is install protobuf version for your supported OS by following these instructions here.

Once you've downloaded the file, extract the zip file. If you're using Windows: in the zip folder, you'll have two folders - bin and include. you'll find the protoc.exe in the bin. Copy that to the Scripts folder inside of the Python folder (Where you have Python installed in your system). now add this path to the Path environment Variables.

syiming commented 4 years ago

Hi, it seems your shell recognize 'cd models/research/\nprotoc object_detection/protos/*.proto --python_out=.\n'' as an single command. Did you tried to run these two command separately?

ulfailliyina commented 3 years ago

when i will compile protobufs: (tensorflow2) C:\userS\home\documents >cd C:\tensorflow1\models\research (tensorflow2) C:\tensorflow1\models\research > protoc --python_out=. .\object_detection\protos....

'protoc' is not recognized as an internal or external command, operable program or batch file.

anyone can help me?

RafaMatos026 commented 1 year ago

I have python installed and i have no "Script" folder @spranjal25