datitran / object_detector_app

Real-Time Object Recognition App with Tensorflow and OpenCV

Home Page:https://medium.com/towards-data-science/building-a-real-time-object-recognition-app-with-tensorflow-and-opencv-b7a2b4ebdc32

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

while running the object_detection.py file getting following error?

renjith-tring opened this issue · comments

output_q.put(detect_objects(frame, sess, detection_graph))
File "test.py", line 48, in detect_objects
feed_dict={image_tensor: image_np_expanded})
File "/home/renjith/venv/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 895, in run
run_metadata_ptr)
File "/home/renjith/venv/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1093, in _run
np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
File "/home/renjith/venv/lib/python3.5/site-packages/numpy/core/numeric.py", line 531, in asarray
return array(a, dtype, copy=False, order=order)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Resolved:
The problem is the OpenCV doesn't install properly in the python3.5, please follow the Cmake flags while installing Opencv
cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=OFF \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ -D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python \ -D BUILD_EXAMPLES=ON \ -D PYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.5m.so \ -D PYTHON_NUMPY_INCLUDE_DIR=~/.virtualenvs/cv/lib/python3.5/site-packages/numpy/core/include \ -D BUILD_opencv_python3=ON \ -D PYTHON_PACKAGES_PATH=~/.virtualenvs/cv/lib/python3.5/site-packes ..

commented

@renjith-tring If it is under Windows how to solve it? thanks for your help.