command = f"python {yolo_root_path}/train.py --img {img_size} --batch {batch_size} --epochs {epochs} --data {basic_path}/data.yaml --cfg {yolo_root_path}/models/{yolov5_weight_name}.yaml --weights {yolov5_weight_name}.pt --name {output_name}"
pytorch로 yolov5버전모델을 위와같이 학습시켜서 가중치파일을 생성하였습니다.
그리고 이 가중치파일에 추가학습을 시키고자 파이참에서 아래와 같이 실행하였습니다.
command = f"python {yolo_root_path}\train.py --data {basic_path}\data.yaml --weights {my_weight_file} --batch-size {batch_size} --epochs {epochs} --resume"
그런데 맨아래 기재한 것처럼 권한오류가 발생합니다.
권한오류가 나는 이유를 모르겠네요...
동일한 경험을 통해서 해결하신분들의 답변을 부탁드립니다.
C:\ProgramData\anaconda3\envs\env_py3.12.4\python.exe D:\DEV\Pycharm\MyPy\deep\train.py
[command] python D:/DEV/Pycharm/yolo/yolov5-master\train.py --data D:\DEV\ETC\YOLOv5test\data.yaml --weights D:/DEV/Pycharm/mine_model.pt/mine_best_20240619_1023.pt --batch-size 10 --epochs 1 --resume
github: skipping check (not a git repository), for updates see GitHub - ultralytics/yolov5: YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
train: weights=D:/DEV/Pycharm/mine_model.pt/mine_best_20240619_1023.pt, cfg=, data=D:\DEV\ETC\YOLOv5test\data.yaml, hyp=....\yolo\yolov5-master\data\hyps\hyp.scratch-low.yaml, epochs=1, batch_size=10, imgsz=640, rect=False, resume=True, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, evolve_population=....\yolo\yolov5-master\data\hyps, resume_evolve=None, bucket=, cache=None, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=....\yolo\yolov5-master\runs\train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest, ndjson_console=False, ndjson_file=False
Traceback (most recent call last):
File "D:\DEV\Pycharm\yolo\yolov5-master\train.py", line 848, in
main(opt)
File "D:\DEV\Pycharm\yolo\yolov5-master\train.py", line 584, in main
d = torch.load(last, map_location="cpu")["opt"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\env_py3.12.4\Lib\site-packages\torch\serialization.py", line 997, in load
with _open_file_like(f, 'rb') as opened_file:
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\env_py3.12.4\Lib\site-packages\torch\serialization.py", line 444, in _open_file_like
return _open_file(name_or_buffer, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\env_py3.12.4\Lib\site-packages\torch\serialization.py", line 425, in init
super().init(open(name, mode))
^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '.'