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

can't load object_detection.py #1

Open
Nyceane opened this issue Sep 12, 2017 · 28 comments
Open

can't load object_detection.py #1

Nyceane opened this issue Sep 12, 2017 · 28 comments

Comments

@Nyceane
Copy link

Nyceane commented Sep 12, 2017

Hey, I am getting an error loading this.

[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[INFO/ForkPoolWorker-2] child process calling self.run()
[DEBUG/MainProcess] Queue._start_thread()
[DEBUG/MainProcess] doing self._thread.start()
[DEBUG/MainProcess] starting thread to feed data to pipe
[DEBUG/MainProcess] ... done self._thread.start()
[INFO/ForkPoolWorker-1] process shutting down
[DEBUG/ForkPoolWorker-1] running all "atexit" finalizers with priority >= 0
[DEBUG/ForkPoolWorker-1] running the remaining "atexit" finalizers
Process ForkPoolWorker-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
    initializer(*initargs)
  File "object_detection_app.py", line 113, in worker
    graph.LoadTensor(resize(frame/255.0,dim,1)[:,:,(2,1,0)].astype(np.float16), 'user object')
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
[INFO/ForkPoolWorker-1] process exiting with exitcode 1
[DEBUG/MainProcess] cleaning up worker 0
[Level 5/MainProcess] finalizer calling <built-in function close> with args (18,) and kwargs {}
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[INFO/ForkPoolWorker-3] child process calling self.run()

Let me know if you can help

@mantoone
Copy link

Looks like you're not getting an image from the webcam. Do you have a camera available at /dev/video0 ?

@gudovskiy
Copy link
Owner

@Nyceane, I agree with @mantoone. Most likely, you have OpenCV installed from pip3 or deb without video support. You may want to install (I personally did this) from sources which is described in OPTION 2 here or other web-sites.

@Nyceane
Copy link
Author

Nyceane commented Sep 13, 2017

hey @gudovskiy @mantoone

Thanks for the response, I have used OPTION 2 and was able to run video.py and I am able to run yolo_example.py. I don't think there is anything wrong with openCV right now.

I am pasting the full log, can you take a look at it?

The problem seems happening on line 113

File "object_detection_app.py", line 113, in worker
graph.LoadTensor(resize(frame/255.0,dim,1)[:,:,(2,1,0)].astype(np.float16), 'user object')

python3 object_detection_app.py 
[DEBUG/MainProcess] created semlock with handle 140636040278016
[DEBUG/MainProcess] created semlock with handle 140636040273920
[DEBUG/MainProcess] created semlock with handle 140636040269824
[DEBUG/MainProcess] Queue._after_fork()
[DEBUG/MainProcess] created semlock with handle 140636040265728
[DEBUG/MainProcess] created semlock with handle 140636040261632
[DEBUG/MainProcess] created semlock with handle 140636040257536
[DEBUG/MainProcess] Queue._after_fork()
Found stale device, resetting
Device 0 Address: 2 - VID/PID 03e7:2150
Starting wait for connect with 2000ms timeout
Found Address: 2 - VID/PID 03e7:2150
Found EP 0x81 : max packet size is 512 bytes
Found EP 0x01 : max packet size is 512 bytes
Found and opened device
Performing bulk write of 825136 bytes...
Successfully sent 825136 bytes of data in 55.532122 ms (14.170375 MB/s)
Boot successful, device address 2
Found Address: 2 - VID/PID 040e:f63b
done
Booted 2 -> VSC
[DEBUG/MainProcess] created semlock with handle 140636040253440
[DEBUG/MainProcess] created semlock with handle 140636040249344
[DEBUG/MainProcess] created semlock with handle 140636040245248
[DEBUG/MainProcess] created semlock with handle 140636040241152
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-1] Queue._after_fork()
[DEBUG/ForkPoolWorker-1] Queue._after_fork()
[INFO/ForkPoolWorker-1] child process calling self.run()
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[INFO/ForkPoolWorker-2] child process calling self.run()
[DEBUG/MainProcess] Queue._start_thread()
[DEBUG/MainProcess] doing self._thread.start()
[DEBUG/MainProcess] starting thread to feed data to pipe
[DEBUG/MainProcess] ... done self._thread.start()
[INFO/ForkPoolWorker-1] process shutting down
[DEBUG/ForkPoolWorker-1] running all "atexit" finalizers with priority >= 0
[DEBUG/ForkPoolWorker-1] running the remaining "atexit" finalizers
Process ForkPoolWorker-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
    initializer(*initargs)
  File "object_detection_app.py", line 113, in worker
    graph.LoadTensor(resize(frame/255.0,dim,1)[:,:,(2,1,0)].astype(np.float16), 'user object')
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
[INFO/ForkPoolWorker-1] process exiting with exitcode 1
[DEBUG/MainProcess] cleaning up worker 0
[Level 5/MainProcess] finalizer calling <built-in function close> with args (18,) and kwargs {}
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[INFO/ForkPoolWorker-3] child process calling self.run()

@gudovskiy
Copy link
Owner

@Nyceane could you paste content of frame and try calling cv2.imshow() for it?

@Nyceane
Copy link
Author

Nyceane commented Sep 13, 2017

Hey @gudovskiy

It says when I printed it.
frame:
None

@Nyceane
Copy link
Author

Nyceane commented Sep 13, 2017

@gudovskiy

Found some issue, I am able to run python video.py fine, but python3 video.py can't find video source. Let me playing around it a little more.

@gudovskiy
Copy link
Owner

@Nyceane sure. Check whether opencv was installed from pip3 by runnung "pip3 list", you may want to remove pip3 version.

@Nyceane
Copy link
Author

Nyceane commented Sep 13, 2017

hey @gudovskiy

After reinstalling and installing different cameras, i finally got both examples running, but neither of them are finding targets using both YoloTiny and YoloSmall

also, object_detection.py is running at about 1 frame a second with an error on line 73, which is comparing an array of nans (probs) to a float (threshold)

yolo_example is having same problem on line 40, np.array(probs>=threshold

let me know if you ran into same trouble.

screenshot from 2017-09-13 15-46-23
screenshot from 2017-09-13 15-48-32

@gudovskiy
Copy link
Owner

@Nyceane looks like you are using YOLO small which is not producing proper results due to some reason. Only YOLO tiny is working now.

@Nyceane
Copy link
Author

Nyceane commented Sep 14, 2017

@gudovskiy yoloTiny is not producing any results either in both cases, no errors tho

object
yolotiny

@gudovskiy
Copy link
Owner

@Nyceane strange, mine is working even on Raspberry Pi.

@pascalpm
Copy link

Make sure the caffemodel and the prototxt files have the same name! In this case yolo_tiny.caffemodel and yolo_tiny.prototxt when you compile (python3 ./mvNCCompile.pyc data/yolo_tiny.prototxt -s 12).

@Nyceane
Copy link
Author

Nyceane commented Sep 21, 2017

@pascalpm, they are same name

@ashwinnair14
Copy link

@gudovskiy @Nyceane At what FPS does it run ??

@gudovskiy
Copy link
Owner

@ashwinnair14 ~5-6 FPS with USB3

@value56
Copy link

value56 commented Oct 24, 2017

@Nyceane Did you solve your problem? I meet the same problem, python3 video.py can't find video source. How did you solve this problem?

@thepaintedsnipe
Copy link

Hitting the exact same error
Process ForkPoolWorker-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "py_examples/object_detection_app.py", line 113, in worker
graph.LoadTensor(resize(frame/255.0,dim,1)[:,:,(2,1,0)].astype(np.float16), 'user object')
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
[INFO/ForkPoolWorker-1] process exiting with exitcode 1

@thepaintedsnipe
Copy link

Hi,

  1. pip3 list | grep opencv
    this showed up some opencv entries which I removed

  2. then installed the opencv from sources as described in the link you share earlier
    http://milq.github.io/install-opencv-ubuntu-debian/

Now, got it to work
On NCS, I get around 4-5 FPS. I guess this is what every one else is getting too?

Detection error is pretty high.
But your application is a very good started point for those who want to get started.
Improving detection error is just a matter of better training.

Thanks for your effort in putting together this project and sharing with every one.

@gudovskiy
Copy link
Owner

@thepaintedsnipe thank you. other guy solved the same way #4

@gotibhai
Copy link

@gudovskiy Do you have the file for the reading the video stream from a PiCamera instead of cv2.VideoCapture? Or should the videoCapture work on Pi as well using the camera module on its own?

@gudovskiy
Copy link
Owner

@gotibhai as I remember, PiCamera also worked using openCV. I tried its own driver and didn't notice any difference. So, both should work.

@HEUzhouhanwen
Copy link

I met the same error like you ,I cannot get the bounding box on RPI 3 too,I‘m sure there is no problem with the program,because it works well on pc with the same graph.
I think it's NCS not work normally result in this error,I try the inception,it return error,But the hello_ncs_py works well.

@gotibhai
Copy link

@gudovskiy Did the code work as well on the pi as it did on a development host? It's not working well on the pi for me. Even yolo_example.py is not working on the pi.

@HEUzhouhanwen Yeah, My error is a little different. I got it working on the pi hooked on to the monitor. I modified the file a bit to use PiCamera module. Everything worked fine there but then I hooked up an adafruit PITFT 2'4 screen to the pi to show the results there and it doesn't work. The boxes are not showing properly. I'm always getting this same box with 0.05 probability.

@gudovskiy
Copy link
Owner

@gotibhai for PI the difficulty was to install OpenCV. Apart from that everything should work fine but slower due to USB2.0

@gotibhai
Copy link

@gudovskiy Ahh that sucks. OpenCV worked me but it's not predicting properly at all.

@gotibhai
Copy link

@Nyceane did you manage to solve the problem of it not predicting?

@HEUzhouhanwen
Copy link

@Nyceane I solve the problem ,I try all the way to find the error but failed.Today I notice the pc(it can get the bounding box) use the previous version of api, the I install the previous NCS api,so guess what ? I get the bounding box!!!!
image

@mashrin
Copy link

mashrin commented Dec 27, 2017

I am still getting this error.

[DEBUG/MainProcess] created semlock with handle 140640753795072
[DEBUG/MainProcess] created semlock with handle 140640753790976
[DEBUG/MainProcess] created semlock with handle 140640753786880
[DEBUG/MainProcess] Queue._after_fork()
[DEBUG/MainProcess] created semlock with handle 140640753782784
[DEBUG/MainProcess] created semlock with handle 140640753778688
[DEBUG/MainProcess] created semlock with handle 140640753774592
[DEBUG/MainProcess] Queue._after_fork()
Device 0 Address: 2 - VID/PID 03e7:2150
Starting wait for connect with 2000ms timeout
Found Address: 2 - VID/PID 03e7:2150
Found EP 0x81 : max packet size is 512 bytes
Found EP 0x01 : max packet size is 512 bytes
Found and opened device
Performing bulk write of 865212 bytes...
Successfully sent 865212 bytes of data in 75.316412 ms (10.955520 MB/s)
Boot successful, device address 2
Found Address: 2 - VID/PID 03e7:f63b
done
Booted 2 -> VSC
[DEBUG/MainProcess] created semlock with handle 140640753770496
[DEBUG/MainProcess] created semlock with handle 140640753766400
[DEBUG/MainProcess] created semlock with handle 140640753762304
[DEBUG/MainProcess] created semlock with handle 140640753758208
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-1] Queue._after_fork()
[DEBUG/ForkPoolWorker-1] Queue._after_fork()
[INFO/ForkPoolWorker-1] child process calling self.run()
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[INFO/ForkPoolWorker-2] child process calling self.run()
[DEBUG/MainProcess] Queue._start_thread()
[DEBUG/MainProcess] doing self._thread.start()
[DEBUG/MainProcess] starting thread to feed data to pipe
[DEBUG/MainProcess] ... done self._thread.start()
[INFO/ForkPoolWorker-1] process shutting down
[DEBUG/ForkPoolWorker-1] running all "atexit" finalizers with priority >= 0
[DEBUG/ForkPoolWorker-1] running the remaining "atexit" finalizers
Process ForkPoolWorker-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "py_examples/object_detection_app.py", line 113, in worker
graph.LoadTensor(resize(frame/255.0,dim,1)[:,:,(2,1,0)].astype(np.float16), 'user object')
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
[INFO/ForkPoolWorker-1] process exiting with exitcode 1
[DEBUG/MainProcess] cleaning up worker 0
[Level 5/MainProcess] finalizer calling with args (18,) and kwargs {}
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[INFO/ForkPoolWorker-3] child process calling self.run()
^C[INFO/ForkPoolWorker-2] process shutting down
[INFO/ForkPoolWorker-3] process shutting down
[DEBUG/ForkPoolWorker-2] running all "atexit" finalizers with priority >= 0
[DEBUG/ForkPoolWorker-3] running all "atexit" finalizers with priority >= 0
Traceback (most recent call last):
[DEBUG/ForkPoolWorker-2] running the remaining "atexit" finalizers
Process ForkPoolWorker-2:
[DEBUG/ForkPoolWorker-3] running the remaining "atexit" finalizers
File "py_examples/object_detection_app.py", line 170, in
Process ForkPoolWorker-3:
(img, results, img_width, img_height) = output_q.get()
File "/usr/lib/python3.5/multiprocessing/queues.py", line 94, in get
res = self._recv_bytes()
File "/usr/lib/python3.5/multiprocessing/connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "/usr/lib/python3.5/multiprocessing/connection.py", line 407, in _recv_bytes
Traceback (most recent call last):
Traceback (most recent call last):
File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "py_examples/object_detection_app.py", line 112, in worker
frame = input_q.get()
File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.5/multiprocessing/queues.py", line 93, in get
with self._rlock:
File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "/usr/lib/python3.5/multiprocessing/synchronize.py", line 96, in enter
return self._semlock.enter()
File "py_examples/object_detection_app.py", line 112, in worker
frame = input_q.get()
File "/usr/lib/python3.5/multiprocessing/queues.py", line 94, in get
res = self._recv_bytes()
File "/usr/lib/python3.5/multiprocessing/connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "/usr/lib/python3.5/multiprocessing/connection.py", line 407, in _recv_bytes
buf = self._recv(4)
KeyboardInterrupt
File "/usr/lib/python3.5/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
KeyboardInterrupt
[INFO/ForkPoolWorker-3] process exiting with exitcode 1
[INFO/ForkPoolWorker-2] process exiting with exitcode 1
buf = self._recv(4)
File "/usr/lib/python3.5/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
KeyboardInterrupt
[DEBUG/MainProcess] cleaning up worker 1
[Level 5/MainProcess] finalizer calling with args (18,) and kwargs {}
[DEBUG/MainProcess] cleaning up worker 0
[Level 5/MainProcess] finalizer calling with args (19,) and kwargs {}
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-4] Queue._after_fork()
[DEBUG/ForkPoolWorker-4] Queue._after_fork()
[INFO/ForkPoolWorker-4] child process calling self.run()
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-5] Queue._after_fork()
[DEBUG/ForkPoolWorker-5] Queue._after_fork()
[INFO/ForkPoolWorker-5] child process calling self.run()

Can anyone kindly help me out with this.

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

10 participants