'I am trying to execute custom yolov5 object detection model. I am facing following error

Traceback (most recent call last): File "C:\Users\Bhavesh\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\multiprocessing\reductions.py", line 36, in del File "C:\Users\Bhavesh\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\storage.py", line 520, in _free_weak_ref AttributeError: 'NoneType' object has no attribute '_free_weak_ref' AttributeError: 'NoneType' object has no attribute '_free_weak_ref'



Solution 1:[1]

This problem happens more frequently when you are running out of CPU, I think you are running your model on CPU maybe try to switch to GPU if you have a big dataset or make sure the batch size fits your CPU if your dataset isn't that big. Sometimes this problem can disappear if some processes are done.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vially KM