yolov3-channel-and-layer-pruning
yolov3-channel-and-layer-pruning copied to clipboard
剪枝后的cfg文件创建不了
Traceback (most recent call last):
File "slim_prune.py", line 198, in
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'
这个是文件读写的问题,权限不够。
可能是因為你資料夾還未創建,因此無法寫入 .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)