I'm training a Yolov5 model with Torch on Jupyter Notebook using this line of code:
!python train.py --img 416 --batch 16 --epochs 50 --data dataset.yaml --weights yolov5s.pt --cache
but I'm getting this error that says:
Traceback (most recent call last):
File "C:\Users\suzan\Desktop\CSPPEDA\yolov5\train.py", line 29, in <module>
import torch
File "C:\Users\suzan\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\__init__.py", line 123, in <module>
raise err
OSError: [WinError 1455] The paging file is too small for this operation to complete. Error loading "C:\Users\suzan\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib\caffe2_detectron_ops_gpu.dll" or one of its dependencies.
So I searched for answers online and found a solution from Chris O'Bryan (How to efficiently run multiple Pytorch Processes / Models at once ? Traceback: The paging file is too small for this operation to complete), however I'm getting this error in Command Prompt as I run the fixNvPe.py python script:
Failed to write modified DLL! [[WinError 5] Access is denied: 'C:\\Users\\suzan\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\torch\\lib\\torch_cuda_cu.dll']
I looked back at the explanation from the first solution by Chris, in which he said "If it is under Program Files, you will need to run the script with administrative privileges". So I run the command prompt as adminstrator and typed in net user administrator /active:yes
, then on the normal command prompt, and rerun the fixNvPe.py python script.
After rerunning it, I tried to train the Yolov5 model again, but the same error OSError: [WinError 1455] The paging file is too small for this operation to complete.
still exists.
Am I running the script in administrative priviledges the correct way? What should I do? I apologize for the question as I'm a beginner in this stuff.