Проблема с удалением артефактов (?) в _optimization_info.py
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
Start with src/autointent/context/optimization_info/_optimization_info.py around dump and the referenced cleanup block, then inspect src/autointent/nodes/_node_optimizer.py where optimization info is saved. Reproduce the decision_f1 preset on Windows and determine why cleanup encounters missing or locked paths. Done means the optimization run saves its information without the reported FileNotFoundError or PermissionError.
Written by the indexing model from the issue text.
Description
Если указать в пресете:
- node_type: decision
target_metric: decision_f1
Получаю ошибку Failed to save optimization info
Трейс ошибки
[I 2025-08-28 09:45:03,556] A new study created in RDB with name: NodeType.scoring
Failed to save optimization info
Traceback (most recent call last):
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\context\optimization_info\_optimization_info.py", line 245, in dump
shutil.rmtree(target_path)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 626, in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 624, in _rmtree_unsafe
os.rmdir(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'data\\runs\\breakable_fly_08-28-2025_09-45-03\\optimization_info\\pydantic'
Failed to save optimization info
Traceback (most recent call last):
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\context\optimization_info\_optimization_info.py", line 245, in dump
shutil.rmtree(target_path)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 622, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 620, in _rmtree_unsafe
os.unlink(fullname)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'data\\runs\\breakable_fly_08-28-2025_09-45-03\\optimization_info\\pydantic\\trials\\model_dump.json'
Failed to save optimization info
Traceback (most recent call last):
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\context\optimization_info\_optimization_info.py", line 245, in dump
shutil.rmtree(target_path)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 626, in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 624, in _rmtree_unsafe
os.rmdir(path)
OSError: [WinError 145] The directory is not empty: 'data\\runs\\breakable_fly_08-28-2025_09-45-03\\optimization_info\\pydantic'
Failed to save optimization info
Traceback (most recent call last):
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\context\optimization_info\_optimization_info.py", line 245, in dump
shutil.rmtree(target_path)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 622, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 620, in _rmtree_unsafe
os.unlink(fullname)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'data\\runs\\breakable_fly_08-28-2025_09-45-03\\optimization_info\\pydantic\\artifacts\\class_info.json'
[W 2025-08-28 09:46:16,305] Trial 0 failed with parameters: {'module_idx': 0} because of the following error: FileNotFoundError(2, 'The system cannot find the path specified').
Traceback (most recent call last):
File "D:\intent-classifier\.venv\Lib\site-packages\optuna\study\_optimize.py", line 201, in _run_trial
value_or_values = func(trial)
^^^^^^^^^^^
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\nodes\_node_optimizer.py", line 163, in objective
context.dump_optimization_info()
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\context\_context.py", line 88, in dump_optimization_info
self.optimization_info.dump(self.logging_config.dirpath)
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\context\optimization_info\_optimization_info.py", line 245, in dump
shutil.rmtree(target_path)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 626, in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 624, in _rmtree_unsafe
os.rmdir(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'data\\runs\\breakable_fly_08-28-2025_09-45-03\\optimization_info\\pydantic'
[W 2025-08-28 09:46:16,314] Trial 10 failed with parameters: {'module_idx': 0} because of the following error: FileNotFoundError(2, 'The system cannot find the file specified').
Traceback (most recent call last):
File "D:\intent-classifier\.venv\Lib\site-packages\optuna\study\_optimize.py", line 201, in _run_trial
value_or_values = func(trial)
^^^^^^^^^^^
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\nodes\_node_optimizer.py", line 163, in objective
context.dump_optimization_info()
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\context\_context.py", line 88, in dump_optimization_info
self.optimization_info.dump(self.logging_config.dirpath)
File "D:\intent-classifier\.venv\Lib\site-packages\autointent\context\optimization_info\_optimization_info.py", line 245, in dump
shutil.rmtree(target_path)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 622, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\Astrov\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 620, in _rmtree_unsafe
os.unlink(fullname)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'data\\runs\\breakable_fly_08-28-2025_09-45-03\\optimization_info\\pydantic\\trials\\model_dump.json'
Временный фикс - подавил ошибки FileNotFoundError, PermissionError здесь. В причинах/последствиях не разбирался
with tempfile.TemporaryDirectory(dir=path) as temp_dir:
temp_path = Path(temp_dir)
# Try to save to the temporary directory first
try:
Dumper.dump(self, temp_path, exists_ok=False, exclude=exclude)
# If successful, move the contents to the final destination
if target_path.exists():
for sub in target_path.iterdir():
if sub.is_dir():
try:
shutil.rmtree(sub)
except (FileNotFoundError, PermissionError):
logger.warning(f"Could not remove directory {sub}")
pass
else:
try:
sub.unlink()
except (FileNotFoundError, PermissionError):
logger.warning(f"Could not remove file {sub}")
pass
else:
target_path.mkdir(parents=True, exist_ok=True)
shutil.move(temp_path, target_path)
except Exception:
logger.exception("Failed to save optimization info")
raise
- Dominant language
- Python
- Stars
- 53
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deeppavlov/AutoIntent
-
`OptimizationConfig.seed` is `PositiveInt` — `seed=0` is rejected while `Pipeline(seed=0)` accepts itPossibly taken @Gambit-Checkmate claimed this 21 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
deeppavlov/AutoIntent#352 ·
-
Extract `BaseAPIDescriptionScorer` shared by `LLMDescriptionScorer` and `TypeSafeDescriptionScorer`Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
deeppavlov/AutoIntent#357 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
deeppavlov/AutoIntent#356 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 72/100
deeppavlov/AutoIntent#355 · 1 comment ·
-
`LLMDescriptionScorer` runs cache hits through the `max_per_second` limiter — 10 s per 100 cached utterancesPossibly taken @kayaal34 claimed this 21 days ago. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 58/100
deeppavlov/AutoIntent#354 ·
All issues in deeppavlov/AutoIntent
Similar issues
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
python-version
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug javascript P2-medium python release:v3.1
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
adrirubio/claude-deck#546 ·
Maintainers usually reply within 1 day
-
area: desktop area: website priority: P2 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
appandflow/stim#3411 · 1 comment ·
Maintainers usually reply within 1 day