sign-language-alphabet-recognizer icon indicating copy to clipboard operation
sign-language-alphabet-recognizer copied to clipboard

Cannot run classify_webcam.py

Open ls4cfk opened this issue 6 years ago • 14 comments

I'm getting this error while running classify_webcam.py

Traceback (most recent call last): File "classify_webcam.py", line 34, in in tf.gfile.GFile("logs/output_labels.txt")] File "classify_webcam.py", line 33, in label_lines = [line.rstrip() for line File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py", line 213, in next return self.next() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py", line 207, in next retval = self.readline() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py", line 176, in readline self._preread_check() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py", line 78, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "/usr/lib/python3.6/contextlib.py", line 88, in exit next(self.gen) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.NotFoundError: logs/output_labels.txt

ls4cfk avatar Nov 23 '18 13:11 ls4cfk

In classify_webcam.py file, change output_labels.txt to trained_labels.txt and output_graph.pb to trained_graph.pb (as per the name that you have specified during retraining process)

eswarnitk avatar Dec 07 '18 09:12 eswarnitk

I'm getting this error while running classify_webcam.py

Traceback (most recent call last): File "classify_webcam.py", line 34, in in tf.gfile.GFile("logs/output_labels.txt")] File "classify_webcam.py", line 33, in label_lines = [line.rstrip() for line File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py", line 213, in next return self.next() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py", line 207, in next retval = self.readline() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py", line 176, in readline self._preread_check() File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/lib/io/file_io.py", line 78, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "/usr/lib/python3.6/contextlib.py", line 88, in exit next(self.gen) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.NotFoundError: logs/output_labels.txt

did classify.py run using docker if then please explain me how to give the path in command line for that

monoharmayumrohitsharma avatar Feb 20 '19 10:02 monoharmayumrohitsharma

Hi Rohit,

Yes, you can run the classify_webcam.py file using docker command. From host machine you have to mount the location of source code to container and set that as working directory in the command.

The syntax is as follows,

docker run -it -v hostmachine_dir:container_dir --working_dir=path_on_container python/python3 program_name

eswarnitk avatar Feb 21 '19 11:02 eswarnitk

Hi Rohit,

Yes, you can run the classify_webcam.py file using docker command. From host machine you have to mount the location of source code to container and set that as working directory in the command.

The syntax is as follows,

docker run -it -v hostmachine_dir:container_dir --working_dir=path_on_container python/python3 program_name

thanks for the reply but i tried on my system it worked the only thing that concerned me to run classify.py which path/to/image.jpg should i mention

monoharmayumrohitsharma avatar Feb 22 '19 06:02 monoharmayumrohitsharma

screenshot from 2019-02-22 12-05-52 i m confuse to which path i should mention is it the dataset because it contains the image file but i tried and it didn't work saying dataset is a directory

monoharmayumrohitsharma avatar Feb 22 '19 06:02 monoharmayumrohitsharma

Hi Rohit,

Yes, you can run the classify_webcam.py file using docker command. From host machine you have to mount the location of source code to container and set that as working directory in the command.

The syntax is as follows,

docker run -it -v hostmachine_dir:container_dir --working_dir=path_on_container python/python3 program_name

classify_webcam.py works fine for me only the issue is with classify.py sorry for the inconvenient.

monoharmayumrohitsharma avatar Feb 22 '19 06:02 monoharmayumrohitsharma

i did the desired changes. but now it's not showing any output. i am running classify_webcam.py but my computer is showing no response. what can be the reason? the webcam is not opening.

someshium avatar Oct 06 '20 07:10 someshium

@manoharmayurohitsharma

did it worked for you? is that classify_webcam.py workin

someshium avatar Oct 06 '20 07:10 someshium

I am having the same circumstances as @someshium Did you find any alternatives ??

Aryamn avatar Oct 19 '20 20:10 Aryamn

@eswarnitk the Classify_webcam.py is not working for mine. i have done the corrections but still when i run it, it shows nothing. remains stucks for infinity untill i exits myself.

someshium avatar Oct 22 '20 07:10 someshium

@Aryamn Not yet. i have no hope left with this one. did you found any other good repo for reference?

someshium avatar Oct 22 '20 07:10 someshium

@someshium , can you please elaborate the problem?. Show me your terminal error.

Please check your model and label names in the .py file.

eswarnitk avatar Oct 22 '20 08:10 eswarnitk

I think there is a problem with cv2 library. I have not figured it out fully though

Aryamn avatar Oct 22 '20 08:10 Aryamn

@eswarnitk Thankyou for reply. sir this is what it's showing for me.

gt

I am getting no error or nothing happens once i Run python3 classify_webcam.py file. stuck for infinity. don't know what is the problem. the image classifier works fine. but this webcam one is not working. It's a big problem. I am still figuring it out. if you have any other reference repo similar to this please suggest me. thanks.

someshium avatar Oct 23 '20 13:10 someshium