Unable to load image

[1000 dc bounty] How the frick do I make pip realize that the torch I built from source (2.0.0a0+gite9ebda2) is actually torch (2.0.0) and it doesn't need to uninstall it, download the off the shelf version and install that?

I need to use this version of torch because I built it with ROCM support for my old GPU but every time I attempt to install or update anything that requires torch pip uninstalls 2.0.0a0+gite9ebda2, downloads 2.0.0 from the torch site and installs that. It's a major pain and I'm sick of having to manually reinstall 2.0.0a0+gite9ebda2 all the time.

!codecels

16
Jump in the discussion.

No email address required.

Closed. This question is seeking recommendations for books, cowtools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don't allow questions seeking recommendations for books, cowtools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Jump in the discussion.

No email address required.

u triggered me

Jump in the discussion.

No email address required.

Please move your discussion to the chat.

Jump in the discussion.

No email address required.

Sounds like something is installing from a requirements.txt somewhere, change that/remove the requirement of torch(2.0.0) in it

Jump in the discussion.

No email address required.

Yea it's because I'm using pip -U to update some libs I have installed. It would be so much god darn work to download them all, edit all teh requirements and install them.

Jump in the discussion.

No email address required.

Paste the requirements or setup file

Jump in the discussion.

No email address required.

Find your python site-packages folder. Find torch. Change every reference of your undesired version to your desired version.

Idk where it checks, I found the version in both a version.py file in the torch directory as well as the METADATA file in the .dist-info folder.

Jump in the discussion.

No email address required.

Pip install /path/to/torch.whl

Jump in the discussion.

No email address required.

I'm doing that rn after pip downloads and installs the wrong torch version, but I want it to not download it all. My end goal is to make pip think 2.0.0a0+gite9ebda2 == 2.0.0 an just go with it

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

But that doesn't work when I use pip install -U to update my installed libs.

Jump in the discussion.

No email address required.

I don't use pip but I thin I can help U.

pip install -U

just seems to recursively attempt an upgrade on all ur pkgs.

To verify I'm right so far open ur terminal and type this

pip list --format=freeze | grep -i torch

Your torch & version number should pop up. Just typing in

pip list --format=freeze

will bring up all ur stuff.

So if I'm right so far it's just a simple script & we can make it ez for u to run later like a real command. First we'll mod the list & remove torch from it, then do what -U does.

create a file and call it, say, pip_U

touch pip_U

then give it execution permissions

chmod +x pip_U

open it and plop this in

pip list --format=freeze \
| cut -d= -f1 \
| grep -v '^torch'

the cut gets = as the delimiter and keep first column (just the name, strip version number)

grep's -v flag returns everything that doesn't match, and the ^ is regex to only remove what starts with torch (in case there's another package with torch in the middle of the name).

U can safely run it by typing ./pip_U

This gives u a list of all ur packages except for torch.

Then we do what -U does and go down the list using xargs. -I@ stores the pkg name in variable @, sh -c opens a subshell to run the install command.

We'll just echo it for double checking & if it looks good we'll remove the echo and let it run for real.

pip list --format=freeze \
| cut -d= -f1 \
| grep -v '^torch' \
| xargs -I@ sh -c "echo 'pip install -U @'"

running this will print literally

pip install -U somePackageName
...

If it looks right we get rid of the echo and let it run it for real, so the final script becomes

pip list --format=freeze \
| cut -d= -f1 \
| grep -v '^torch' \
| xargs -I@ sh -c "pip install -U @"

Save this file into one of your bins.

run ::$ echo $PATH

there should be something like

/usr/local/bin

move the file there

sudo mv pip_U /usr/local/bin/.

now you can run it without the ./ and from any directory, from any user.

type ::$ pip_U

should work, probably

Jump in the discussion.

No email address required.

@iStillMissEd

:marseywait:

i don't care about the coin just tell me if it works

Jump in the discussion.

No email address required.

Nope, When it gets to TTS (the package that's giving me issues) it still tries downloading torch

Jump in the discussion.

No email address required.

oh wait.. TTS is the package name?

Jump in the discussion.

No email address required.

Yea TTS requires torch and torchaudio, but REEEEEs about the version I built from source being called '2.0.0a0+gite9ebda2' and not just '2.0.0' and tries to uninstall it and install 2.0.0 (which doesn't support my GPU)

Jump in the discussion.

No email address required.

More comments

What?

Jump in the discussion.

No email address required.

I like having a small peepee.

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.