I am trying to train a YOLOv5 CNN on a custom dataset with around 10000 training examples, but I keep getting the following error:
C:\Program Files\Python39\lib\site-packages\setuptools\distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
warnings.warn(
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Program Files\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Program Files\Python39\lib\multiprocessing\spawn.py", line 125, in _main
prepare(preparation_data)
File "C:\Program Files\Python39\lib\multiprocessing\spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Program Files\Python39\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "C:\Program Files\Python39\lib\runpy.py", line 268, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Program Files\Python39\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Malth\OneDrive - Aarhus Universitet\7. Semester\DL\YOLO\yolov5\train.py", line 20, in <module>
import torch
File "C:\Users\Malth\AppData\Roaming\Python\Python39\site-packages\torch\__init__.py", line 124, in <module>
raise err
OSError: [WinError 1455] The paging file is too small for this operation to complete. Error loading "C:\Users\Malth\AppData\Roaming\Python\Python39\site-packages\torch\lib\caffe2_detectron_ops_gpu.dll" or one of its dependencies.
Right before the error occurs the program uses up the entirety of my pagefile of 30GB + 10GB of assigned RAM.
I am running train.py with the following command:
python train.py --rect --batch 16 --epochs 3 --data CCPDMini.yaml --weights yolov5s.pt
My python version is 3.9.2
My PyTorch version is 1.9.1+cu111
I have the following setup:
Intel Core i7-4790 CPU
16 GB RAM
RTX2070 8GB VRAM
I have already tried reducing the batch size and the number of dataloader workers, but to no awail