tfaehse / DashcamCleaner

Censor identifiable information in videos, in particular dashcam recordings in Germany.
GNU Affero General Public License v3.0
130 stars 27 forks source link

Getting an error #46

Closed Sohailsaifi closed 1 year ago

Sohailsaifi commented 1 year ago

I tried executing it on a video file. When I run the script, I get this error:

Traceback (most recent call last): File "cli.py", line 218, in cli.start_blurring() File "cli.py", line 31, in start_blurring blurrer.blur_video() File "/home/ubuntu/DashcamCleaner/dashcamcleaner/src/blurrer.py", line 191, in blur_video new_detections: List[List[Detection]] = self.detect_identifiable_information(frame_buffer) File "/home/ubuntu/DashcamCleaner/dashcamcleaner/src/blurrer.py", line 138, in detect_identifiable_information results_list = self.detector(images, size=scale).xyxy File "/home/ubuntu/myenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/ubuntu/myenv/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(args, **kwargs) File "/home/ubuntu/.cache/torch/hub/ultralytics_yolov5_master/models/common.py", line 627, in forward g = max(size) / max(s) # gain TypeError: 'float' object is not iterable

tfaehse commented 1 year ago

Any chance you updated torch(hub) lately? Try deleting your torch cache, it should be located in .cache/torch in your home directory.

If that doesn't help I can't (immediately) tell you what's up, but I'll get back to it in ~2 weeks.

Dave04O4 commented 1 year ago

https://github.com/tfaehse/DashcamCleaner/issues/48

After the bug came this:

Fusing layers...
Model summary: 308 layers, 21041679 parameters, 0 gradients
Adding AutoShape...
Using NVIDIA GeForce RTX 2080.
Worker created
Blurrer started!
Traceback (most recent call last):
File "d:\Dashcam\D1\dashcamcleaner\src\qt_wrapper.py", line 70, in run
new_detections = self.detect_identifiable_information(frame_buffer)
File "d:\Dashcam\D1\dashcamcleaner\src\blurrer.py", line 137, in detect_identifiable_information
results_list = self.detector(images, size=scale).xyxy
File "D:\Dashcam\Anaconda\envs\P1\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "D:\Dashcam\Anaconda\envs\P1\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "C:\Users\heine/.cache\torch\hub\ultralytics_yolov5_master\models\common.py", line 683, in forward
g = max(size) / max(s) # gain
TypeError: 'float' object is not iterable
tfaehse commented 1 year ago

That's almost embarrassing, there was an external change. model() requires a tuple now, not an int/float - it was my torch cache that was out of date. Reproduced and fixed by @knrdl!