The error you're encountering:
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program...
indicates that multiple OpenMP runtime libraries (libiomp5md.dll) are loaded into your Python process. This is a common problem when you have multiple libraries or frameworks that each bring their own OpenMP runtime, causing conflicts. For example, this often happens if you have both Intel’s and another vendor’s OpenMP runtime or if your Python packages (e.g., numpy, scikit-learn, PyTorch, TensorFlow) bring different versions or lots of DLLs.
How to handle / fix this:
1. Quick workaround:
Set the environment variable KMP_DUPLICATE_LIB_OK=TRUE before running your script.
-
On Windows command prompt, run:
set KMP_DUPLICATE_LIB_OK=TRUE
python trainer.py --dataset_path "C:\Users\DjZaN\OneDrive\Desktop\Zen\dataset.json" --checkpoint_dir "C:\Users\DjZaN\.cache\ace-step\checkpoints" --exp_name "DaltOniX"
-
Or you can prefix your command in PowerShell:
$env:KMP_DUPLICATE_LIB_OK = "TRUE"
python trainer.py --dataset_path "C:\Users\DjZaN\OneDrive\Desktop\Zen\dataset.json" --checkpoint_dir "C:\Users\DjZaN\.cache\ace-step\checkpoints" --exp_name "DaltOniX"
Note: This is not recommended long term because it can mask issues and cause crashes or incorrect results.
2. Better solutions:
-
Check if you have mixed libraries that bundle their own OpenMP runtimes. Common culprits on Windows include:
- Intel MKL / Intel OpenMP runtime &
- Other OpenMP-enabled libraries like PyTorch, TensorFlow, numpy (MKL variant), etc.
-
Update your packages to ensure compatibility and consistent OpenMP versions:
-
Use conda environment if not already: Conda manages dependencies better, reducing these conflicts.
-
If you are using multiple Python packages that are sometimes installed with conflicting OpenMP runtimes, try to use the conda-forge versions or unify libraries installed via conda or pip.
-
Isolate your environment: Create a fresh environment with minimal packages. Then install only the required packages and test if the error persists.
3. Diagnosing OpenMP runtime conflicts:
- Try running code snippets that import your libraries individually and see if you get the same message.
- Check which DLLs are loaded by your Python process (e.g., using Process Explorer) and whether multiple
libiomp5md.dll copies come from different locations.
If none of the above works, please share the list of installed Python packages (pip list or conda list) and how you installed them.
Summary
For now, try:
set KMP_DUPLICATE_LIB_OK=TRUE
python trainer.py --dataset_path "C:\Users\DjZaN\OneDrive\Desktop\Zen\dataset.json" --checkpoint_dir "C:\Users\DjZaN\.cache\ace-step\checkpoints" --exp_name "DaltOniX"
But eventually investigate and fix the root cause by managing your dependencies or environment to avoid multiple OpenMP runtimes.
Let me know if you want help diagnosing further!