DVC|权限被拒绝错误:无法再现阶段:无法运行:.py,已退出,返回126



目标:通过运行.py文件。CCD_ 2。

dvc.yaml中,它之前有一些阶段不会产生错误。

dvc exp run:

(venv) me@ubuntu-pcs:~/PycharmProjects/project$ dvc exp run
Stage 'inference' didn't change, skipping
Running stage 'load_data':
> load_data.py
/bin/bash: line 1: load_data.py: Permission denied
ERROR: failed to reproduce 'load_data': failed to run: load_data.py, exited with 126

dvc repro:

(venv) me@ubuntu-pcs:~/PycharmProjects/project$ dvc repro
Stage 'predict' didn't change, skipping                                                                                                                                                                                                                        
Stage 'evaluate' didn't change, skipping
Stage 'inference' didn't change, skipping
Running stage 'load_data':
> load_data.py
/bin/bash: line 1: load_data.py: Permission denied
ERROR: failed to reproduce 'load_data': failed to run: pdl1_lung_model/load_data.py, exited with 126

dvc doctor:

DVC version: 2.10.2 (pip)
---------------------------------
Platform: Python 3.9.12 on Linux-5.15.0-46-generic-x86_64-with-glibc2.35
Supports:
webhdfs (fsspec = 2022.5.0),
http (aiohttp = 3.8.1, aiohttp-retry = 2.5.2),
https (aiohttp = 3.8.1, aiohttp-retry = 2.5.2),
s3 (s3fs = 2022.5.0, boto3 = 1.21.21)
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/nvme0n1p5
Caches: local
Remotes: s3
Workspace directory: ext4 on /dev/nvme0n1p5
Repo: dvc, git

dvc exp run -v:

output.txt

dvc exp run -vv:

output2.txt

解决方案1

.py文件未作为脚本运行。

他们需要;如果要在dvc.yaml中的每个stage运行一个.py文件。

为此,您需要在每个.py文件的底部附加锅炉板代码

if __name__ == "__main__":
# invoke primary function() in .py file, w/ params

解决方案2

chmod 777 ....py

Soution 3

我忘记了cmd:中的python

load_data:
cmd: python pdl1_lung_model/load_data.py

相关内容

最新更新