Skip to content

fix: Python version check for PyTorch installation compatibility#15390

Merged
AUTOMATIC1111 merged 2 commits intoAUTOMATIC1111:devfrom
ochen1:patch-1
Mar 30, 2024
Merged

fix: Python version check for PyTorch installation compatibility#15390
AUTOMATIC1111 merged 2 commits intoAUTOMATIC1111:devfrom
ochen1:patch-1

Conversation

@ochen1
Copy link
Copy Markdown
Contributor

@ochen1 ochen1 commented Mar 27, 2024

Description

you cannot use An arbitrary precision calculator language to compare python versions

eg. bc will think 3.10 and 3.1 are the same

As such, we must update the script to maintain a consistent two-decimal format for comparison by modifying the version calculation to ensure that the minor version is always represented with two decimal places.

Screenshots/videos:

pyv="$(${python_cmd} -c 'import sys; print(".".join(map(str, sys.version_info[0:2])))')"
if [[ $(bc <<< "$pyv <= 3.10") -eq 1 ]] 
then
    # Navi users will still use torch 1.13 because 2.0 does not seem to work.
    export TORCH_COMMAND="pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/rocm5.6"
else
    printf "\e[1m\e[31mERROR: RX 5000 series GPUs must be using at max python 3.10, aborting...\e[0m"
    exit 1
fi

image
image

Checklist:

@ochen1 ochen1 requested a review from AUTOMATIC1111 as a code owner March 27, 2024 03:29
@AUTOMATIC1111 AUTOMATIC1111 changed the base branch from master to dev March 30, 2024 04:30
@AUTOMATIC1111
Copy link
Copy Markdown
Owner

welp i fucked the merge

@AUTOMATIC1111 AUTOMATIC1111 merged commit 470d402 into AUTOMATIC1111:dev Mar 30, 2024
@ochen1 ochen1 deleted the patch-1 branch March 31, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants