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

Using this sample with GPU support #10

Open
sa7ina opened this issue Jun 12, 2018 · 5 comments
Open

Using this sample with GPU support #10

sa7ina opened this issue Jun 12, 2018 · 5 comments

Comments

@sa7ina
Copy link

sa7ina commented Jun 12, 2018

Hi
And thanks for this repo.

I got it to work "OUT OF THE BOX" with tensorflow cpu 1.4.0 in the requirements.txt.
But it does not work with any other cpu version of tensorflow nor 1.4.0-gpu or any other gpu version.
Tried hard in the last couple days (even installed ubuntu more than 10 times breaking and starting all over again) but no success so far. only TF1.4.0 cpu.
Other examples i use works flawlessly with my GPU. GTX1080.

Any idea why and how to fix this excellent example code to work with gpu even newer version of tensorflow?

10X
--{-@

@sa7ina
Copy link
Author

sa7ina commented Jun 12, 2018

This is what i get when i use TF1.4.0-gpu.

`$ python eval.py
Traceback (most recent call last):
File "eval.py", line 20, in
import tensorflow as tf
File "/home/ei8ht/.local/lib/python2.7/site-packages/tensorflow/init.py", line 24, in
from tensorflow.python import *
File "/home/ei8ht/.local/lib/python2.7/site-packages/tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/home/ei8ht/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 72, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/ei8ht/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/ei8ht/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/ei8ht/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.`

@saket424
Copy link

@sa7ina
This error is because you done have CUDA 8.0 libraries installed

@igor-panteleev
I tried using tensorflow-gpu 1.5 since it uses CUDA 9.0 libraries but I get the following error. Can you take a look?

(va3) anand@Alienware15:~/objd/devicehive-video-analysis$ python eval.py
Traceback (most recent call last):
File "/home/anand/.virtualenvs/va3/lib/python3.6/site-packages/absl/flags/_flag.py", line 166, in _parse
return self.parser.parse(argument)
File "/home/anand/.virtualenvs/va3/lib/python3.6/site-packages/absl/flags/_argument_parser.py", line 114, in parse
type(argument)))
TypeError: flag value must be a string, found "<class 'int'>"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "eval.py", line 123, in
tf.flags.DEFINE_string('video', 0, 'Path to the video file.')
File "/home/anand/.virtualenvs/va3/lib/python3.6/site-packages/tensorflow/python/platform/flags.py", line 58, in wrapper
return original_function(*args, **kwargs)
File "/home/anand/.virtualenvs/va3/lib/python3.6/site-packages/absl/flags/_defines.py", line 241, in DEFINE_string
DEFINE(parser, name, default, help, flag_values, serializer, **args)
File "/home/anand/.virtualenvs/va3/lib/python3.6/site-packages/absl/flags/_defines.py", line 81, in DEFINE
DEFINE_flag(_flag.Flag(parser, serializer, name, default, help, **args),
File "/home/anand/.virtualenvs/va3/lib/python3.6/site-packages/absl/flags/_flag.py", line 107, in init
self._set_default(default)
File "/home/anand/.virtualenvs/va3/lib/python3.6/site-packages/absl/flags/_flag.py", line 196, in _set_default
self.default = self._parse(value)
File "/home/anand/.virtualenvs/va3/lib/python3.6/site-packages/absl/flags/_flag.py", line 169, in _parse
'flag --%s=%s: %s' % (self.name, argument, e))
absl.flags._exceptions.IllegalFlagValueError: flag --video=0: flag value must be a string, found "<class 'int'>"

@MartinWeniger
Copy link

@saket424: i had the same Problem, i made it when i changed
tf.flags.DEFINE_string('video', 0, 'Path to the video file.') (the 0 is here an int)
to
tf.flags.DEFINE_string('video', '0', 'Path to the video file.') (the 0 is here an string)

And for Webcam mode i changed
cam = cv2.VideoCapture(Video)
to
cam = cv2.VideoCapture(0)

@MartinWeniger
Copy link

MartinWeniger commented Jul 2, 2018

it runs for me under Windows 10 (64bit), with Tensorflow 1.8 gpu and python 3.5.5 with constant 8 FPS
i hopw it helps u

@saket424
Copy link

saket424 commented Jul 2, 2018

@MartinWeniger,
Thanks for this tips. With those two changes to eval.py that you outlined, I got it working using tensorflow-gpu 1.8 and I am getting 15fps on a nvidia geforce GTX 1080ti

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

3 participants