Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run classify_webcam.py #12

Open
ls4cfk opened this issue Nov 23, 2018 · 14 comments
Open

Cannot run classify_webcam.py #12

ls4cfk opened this issue Nov 23, 2018 · 14 comments

Comments

@ls4cfk
Copy link

ls4cfk commented Nov 23, 2018

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

@eswarnitk
Copy link

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)

@monoharmayumrohitsharma

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

@eswarnitk
Copy link

eswarnitk commented Feb 21, 2019

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

@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

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

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

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.

@someshium
Copy link

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
Copy link

@manoharmayurohitsharma

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

@Aryamn
Copy link

Aryamn commented Oct 19, 2020

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

@someshium
Copy link

@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
Copy link

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

@eswarnitk
Copy link

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

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

@Aryamn
Copy link

Aryamn commented Oct 22, 2020

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

@someshium
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants