CPAI Runtime Error

gadgetguy

n3wb
Joined
Jan 28, 2022
Messages
4
Reaction score
0
Location
CA
Issue: I have the following error pop up in CPAI a few times a day, though the system seems to function properly. i7 6th gen, GTX1650, fresh install.

Troubleshooting: Completely fresh installation of Windows, BI, and AI (plus supporting components).

Code:
24:20:26:Object Detection (YOLOv5 6.2):  [RuntimeError] : Traceback (most recent call last):
  File "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYolo\detect.py", line 162, in do_detection
    det = detector(img, size=640)
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context
    return func(*args, **kwargs)
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\yolov5\models\common.py", line 705, in forward
    y = self.model(x, augment=augment)  # forward
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\yolov5\models\common.py", line 515, in forward
    y = self.model(im, augment=augment, visualize=visualize) if augment or visualize else self.model(im)
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\Lib\site-packages\yolov5\models\yolo.py", line 209, in forward
    return self._forward_once(x, profile, visualize)  # single-scale inference, train
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\Lib\site-packages\yolov5\models\yolo.py", line 121, in _forward_once
    x = m(x)  # run
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Program Files\CodeProject\AI\runtimes\bin\windows\python37\venv\Lib\site-packages\yolov5\models\yolo.py", line 75, in forward
    wh = (wh * 2) ** 2 * self.anchor_grid[i]  # wh
RuntimeError: The size of tensor a (60) must match the size of tensor b (80) at non-singleton dimension 3
Details:

I've been in the process of revamping my surveillance from a 4th gen i5 with basic motion detection (I had tinkered around with DS a year or two back but the machine was a little old to analyze quickly and reliably) to a 6th gen i7 with GTX1650. Presently, they're both running concurrently with the new box running an evaluation version of BI. I started from scratch as the 4th gen had undergone many config changes over the years with experimental cameras and all that - it was just time. I started with a Quadro P400 but still wasn't getting down to the times I wanted and stumbled across a low profile GTX1650 locally and jumped on it.

Everything seemed to run properly when I had the P400 installed, except that the SSD I'd installed to boot was having issues with reliability. When I moved to the GTX, I swapped out the SSD and started completely fresh with everything - Windows install, Blue Iris, CPAI server, GPU driver, CUDA 11.7 Toolkit, cuDNN script. The only thing I moved over was my BI configuration. The clip storage drive remained the same as well.

The above error will pop up any time between one and seven times per day. It seems to vary slightly, particularly the last line where the numbers change. I've tried searching for various parts of the error code but it always seem to crop up with something far deeper than my comp sci knowledge goes. I've started from scratch once or twice (again, aside from my BI config) - being less impatient as I went through the install, letting one thing fully install before moving onto the next step, in various orders, uninstalling just CPAI and reinstalling, to no avail. The only clue I have is that, when I first installed with the P400, I don't recall running into a "VS not detected" error (it seems like it installs with BI?) so I did manually install a version of VS on my subsequent installs with the GTX.

Thanks all.
 

tedrpi

Getting the hang of it
Joined
Sep 2, 2015
Messages
85
Reaction score
36
Did you ever get this solved? I had the same issue on 2.0.9 but an uninstall, manual deletion of directories, then a reinstall fixed the issue. I upgraded to 2.0.10 yesterday and am seeing the error again. Tried the uninstall and reinstall but still seeing the same error. The error doesn't appear to be repeating with any regularity for me and doesn't appear to be impacting identifications. If I manually restart CPAI via the BI settings, CPAI comes up w/o the error.

Have you tried re-installing or re-starting CPAI manually to see if you still get the error?

Another thing to consider is if you're using the GPU version, I've read a couple places there may be an issue you have 2GB or less of GPU memory.
 

gadgetguy

n3wb
Joined
Jan 28, 2022
Messages
4
Reaction score
0
Location
CA
No resolution, unfortunately. I just checked and the error seems to be increasing in frequency so I should probably dive back in to attempt to solve it, even though it doesn't seem to be causing any noticeable issues. Very good to know about the manual directory deletion, I did not try that.

I'm going to update here and then try a manual restart, that's another good call, can't say I tried that.

Also good to know about the GPU, however not the issue here as my card is a 4 GB model.
 

gadgetguy

n3wb
Joined
Jan 28, 2022
Messages
4
Reaction score
0
Location
CA
Updated to 2.1.10 last night. I had to restart the computer and then stop/start CPAI in BI for it to start working (which seems to be the case sometimes), but no errors so far!
 
Top