Bartzi / loans

Code for the Paper "LoANs: Weakly Supervised Object Detection with Localizer Assessor Networks"
GNU General Public License v3.0
15 stars 4 forks source link

RuntimeError: cannot join current thread #5

Open Rahul-Venugopal opened 5 years ago

Rahul-Venugopal commented 5 years ago

I have followed the instructions given in the page and have tried to visualize the results using following code ### with video_sheeping.py

python video_sheeping.py figure_skating/models/resnet_50_augmentation_no_noise_75_100/Resnet50SheepLocalizer_97305.npz \log \-i videos/validation_data/video.mp4 \ -g 0 \ -o validation_data/analyzed_video.mp4

And I get the following error

0%| | 0/5 [00:00<?, ?it/s] Could not find encoder for codec id 27: Encoder not found Traceback (most recent call last): | 0/11985 [00:00<?, ?it/s] File "video_sheeping.py", line 107, in sheep(args, localizer, video) File "video_sheeping.py", line 67, in sheep render_scores=args.discriminator is not None AttributeError: 'Namespace' object has no attribute 'discriminator'

Exception ignored in: <bound method tqdm.del of 0%| | 0/11985 [00:17<?, ?it/s]> Traceback (most recent call last): File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 931, in del self.close() File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 1133, in close self._decr_instances(self) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 496, in _decr_instances cls.monitor.exit() File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_monitor.py", line 52, in exit self.join() File "/usr/lib/python3.6/threading.py", line 1053, in join raise RuntimeError("cannot join current thread") RuntimeError: cannot join current thread

with image_sheeping.py

command used as following

python image_sheeping.py figure_skating/models/resnet_50_augmentation_no_noise_75_100/Resnet50SheepLocalizer_97305.npz \log \-i figure_skating/evaluation_dataset/test_images/*.png \ -g 0 \ -o validation_data/images/analyzed Output/error

0%| | 0/6 [00:00<?, ?it/s]Traceback (most recent call last): File "image_sheeping.py", line 44, in bboxes, scores = localizer.localize(processed_image) ValueError: too many values to unpack (expected 2) Exception ignored in: <bound method tqdm.del of 0%| | 0/6 [00:15<?, ?it/s]> Traceback (most recent call last): File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 931, in del self.close() File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 1133, in close self._decr_instances(self) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 496, in _decr_instances cls.monitor.exit() File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_monitor.py", line 52, in exit self.join() File "/usr/lib/python3.6/threading.py", line 1053, in join raise RuntimeError("cannot join current thread") RuntimeError: cannot join current thread

Can anyone suggest a possible solution ?

Bartzi commented 5 years ago

Okay,

for the first error you have two problems:

The second error should now also be fixed...

Rahul-Venugopal commented 5 years ago

Thanks for replying . Yeah now its solved .Thank you

Rahul-Venugopal commented 5 years ago

Hi , I have came across another problem when using my GPU. It works fine when I run it without gpu . But I have following problem using GPU . Maybe anyone had similiar issues before , please help.

My cupy and chainer versions are as follows

Chainer: 4.1.0 NumPy: 1.15.4 CuPy: CuPy Version : 4.1.0 CUDA Root : /usr/local/cuda-9.0 CUDA Build Version : 9000 CUDA Driver Version : 9020 CUDA Runtime Version : 9000 cuDNN Build Version : 7104 cuDNN Version : 7104 NCCL Build Version : 2104

When I execute

python image_sheeping.py figure_skating/models/resnet_50_augmentation_no_noise_75_100/Resnet50SheepLocalizer_97305.npz \log -i figure_skating/evaluation_dataset/test_images/22.png -g 0 -o validation_data/images/analyzed

Error message I am receiving is

Traceback (most recent call last): File "image_sheeping.py", line 50, in bboxes, scores = localizer.localize(processed_image)[:2] File "/home/rahul/Desktop/Thesis/code/loans/loans/sheep/unsupervised_sheep_localizer.py", line 43, in localize bboxes, rois, scores, visual_backprop = self.model.predict([processed_image], return_visual_backprop=return_visual_backprop) File "/home/rahul/Desktop/Thesis/code/loans/loans/figure_skating/models/resnet_50_augmentation_no_noise_75_100/localizer.py", line 102, in predict rois, bboxes = self(images) File "/home/rahul/Desktop/Thesis/code/loans/loans/figure_skating/models/resnet_50_augmentation_no_noise_75_100/localizer.py", line 144, in call h = self.feature_extractor(input_images, layers=['res5', 'pool5']) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/chainer/links/model/vision/resnet.py", line 198, in call h = func(h) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/chainer/links/connection/convolution_2d.py", line 175, in call groups=self.groups) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/chainer/functions/connection/convolution_2d.py", line 582, in convolution_2d y, = fnode.apply(args) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/chainer/function_node.py", line 258, in apply outputs = self.forward(in_data) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/chainer/function_node.py", line 367, in forward return self.forward_gpu(inputs) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/chainer/functions/connection/convolution_2d.py", line 161, in forward_gpu return self._forward_cudnn(x, W, b, y) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/chainer/functions/connection/convolution_2d.py", line 234, in _forward_cudnn auto_tune=auto_tune, tensor_core=tensor_core) File "cupy/cudnn.pyx", line 598, in cupy.cudnn.convolution_forward File "cupy/cudnn.pyx", line 33, in cupy.cudnn.get_handle File "cupy/cuda/cudnn.pyx", line 473, in cupy.cuda.cudnn.create File "cupy/cuda/cudnn.pyx", line 446, in cupy.cuda.cudnn.check_status cupy.cuda.cudnn.CuDNNError: CUDNN_STATUS_INTERNAL_ERROR Exception ignored in: <bound method tqdm.del of 0%| | 0/1 [00:17<?, ?it/s]> Traceback (most recent call last): File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 931, in del self.close() File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 1133, in close self._decr_instances(self) File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_tqdm.py", line 496, in _decr_instances cls.monitor.exit() File "/home/rahul/.virtualenvs/loans/lib/python3.6/site-packages/tqdm/_monitor.py", line 52, in exit self.join() File "/usr/lib/python3.6/threading.py", line 1053, in join raise RuntimeError("cannot join current thread") RuntimeError: cannot join current thread

In requirements.txt it is asked to install cupy==4.1.0 and as per this link , it is recommended to install cupy-cuda90 if I want to enable cuda . Can anyone help me to solve the error ?

Bartzi commented 5 years ago

Hmm, I don't exactly know what might cause this error, but just to be sure: Is the image you are using a grayscale image, or is it a RGB image?

Bartzi commented 5 years ago

Installing cupy, using the requirements.txt file should work out of the box, as cupy will be compiled on your system for your CUDA Version, so as long a CUDA compiling is working on your machine, I'd recommend to compile cupy directly on your system using pip.

Rahul-Venugopal commented 5 years ago

Okay......I am using RGB image and it works well if I am compiling it without gpu (i meant with flag g = -1) . I will check again. Thanks for your reply. Will update here if I am able to solve the problem.

Again , as per this link , i cannot use h264 encoder if I install open-cv using pip. Did you actually build open-CV manually or did you install it by pip ?

Bartzi commented 5 years ago

Hmm, I think I installed openCV via my package manager and also via pip.