yolov3-channel-and-layer-pruning icon indicating copy to clipboard operation
yolov3-channel-and-layer-pruning copied to clipboard

剪枝后的cfg文件创建不了

Open haoxue1215 opened this issue 4 years ago • 3 comments

haoxue1215 avatar Dec 01 '20 13:12 haoxue1215

Traceback (most recent call last): File "slim_prune.py", line 198, in pruned_cfg_file = write_cfg(pruned_cfg_name, [model.hyperparams.copy()] + compact_module_defs) File "D:\Anaconda3\envs\pytorch\ayolo\YOLOv3v4\utils\prune_utils.py", line 137, in write_cfg with open(cfg_file, 'w') as f: PermissionError: [Errno 13] Permission denied: 'cfg/prune_0.5_keep_0.01_yolov4.cfg'

haoxue1215 avatar Dec 01 '20 13:12 haoxue1215

Traceback (most recent call last): File "slim_prune.py", line 198, in pruned_cfg_file = write_cfg(pruned_cfg_name, [model.hyperparams.copy()] + compact_module_defs) File "D:\Anaconda3\envs\pytorch\ayolo\YOLOv3v4\utils\prune_utils.py", line 137, in write_cfg with open(cfg_file, 'w') as f: PermissionError: [Errno 13] Permission denied: 'cfg/prune_0.5_keep_0.01_yolov4.cfg'

这个是文件读写的问题,权限不够。

syswyl avatar Dec 08 '20 11:12 syswyl

可能是因為你資料夾還未創建,因此無法寫入 .cfg 檔,你可以檢查一下資料夾路徑是否正確。 在 slim_prune.py 中 pruned_cfg_name 資料夾路徑確認是否存在,加入以下 cfg_dir_name = os.path.split(pruned_cfg_name)[0] if not os.path.isdir(cfg_dir_name): os.makedirs(cfg_dir_name)

Image 7

chingi071 avatar Dec 23 '20 08:12 chingi071