loicmarie / sign-language-alphabet-recognizer

Simple sign language alphabet recognizer using Python, openCV and tensorflow for training Inception model (CNN classifier).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot run classify_webcam.py

ls4cfk opened this issue · 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

commented

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)

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

commented

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

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

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

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.

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.

@manoharmayurohitsharma

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

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

@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.

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

commented

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

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

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

@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.