-
Notifications
You must be signed in to change notification settings - Fork 192
Description
Runtime crash on start.bat after installing Python via uv (torch / optimum incompatibility)
Summary
On Windows, following the official install flow (including installing Python via uv when prompted), install.bat completes successfully. However, running start.bat fails at runtime with an ImportError related to torch.onnx.symbolic_opset14._attention_scale.
This appears to be caused by an incompatible torch version being installed by uv, due to torch not being version-pinned.
Environment
-
OS: Windows 10 / 11
-
FastSD CPU version:
1.0.0-beta.281 -
Install method:
-
Ran
install.bat -
Python was missing, so followed the installer prompt
-
Installed Python using uv’s official instructions:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"(from https://docs.astral.sh/uv/getting-started/installation/)
-
Re-ran
install.bat→ completed successfully
-
-
Python: installed via uv
-
Torch installed by uv:
2.10.0+cpu
Steps to reproduce
- On a clean Windows system without Python:
- Run
install.bat - When prompted, install Python using uv’s official installer (link provided by the script)
- Re-run
install.bat(completes successfully) - Run
start.bat
Actual behavior
Application crashes immediately at startup with:
ImportError: cannot import name '_attention_scale'
from 'torch.onnx.symbolic_opset14'
Traceback goes through:
optimum.exporters.onnx.model_patcher
→ torch.onnx.symbolic_opset14
Expected behavior
After following the installer’s guidance and a successful install, start.bat should launch the application.
Investigation / Findings
-
torchis importable and reports version:python -c "import torch; print(torch.__version__)"2.10.0+cpu -
pip uninstall torchdoes not work because torch was installed by uv, not pip -
optimum.exporters.onnximports_attention_scale, which no longer exists in newer torch versions -
This causes a runtime import failure, not an installation failure
Verified:
python -c "import torch.onnx.symbolic_opset14 as s; print(hasattr(s, '_attention_scale'))"
# FalseRoot cause
install.batrelies on uv for dependency installationtorchis not pinned inrequirements.txt- uv installs the latest available torch (
2.10.0+cpu) - That torch version is incompatible with Optimum’s ONNX exporter
Workaround
Manually pin torch to a compatible version, delete env, and re-run install:
torch<2.2
(or explicitly)
torch==2.1.2
After this, start.bat runs correctly.
Suggested fix
- Pin torch to a compatible version in
requirements.txt - Or document tested torch versions in the README
This would prevent a successful install followed by an immediate runtime crash.