Open BmanClark opened 1 week ago
Hi @BmanClark, can you try updating Python to 3.11 and then restarting the installation process? I have noticed better stability with that version of Python than the others.
Hi @BmanClark , please install ai-edge-torch with the way you tried in attempt 2. Our release is not tested with torch_xla built by aws, please install dependencies through our requirements.txt.
For your error in attempt 2 ImportError: libpython3.9.so.1.0: cannot open shared object file: No such file or directory
, please set the environment variable LD_LIBRARY_PATH
properly with the path your python is installed. These threads may help your env setup:
You can also use docker to run ai-edge-torch in clean host and python environment.
So... @chunnienc I've done a search and libpython3.9.so does not seem to be on my system. I tried adding everywhere python was installed to the LD_LIBRARY_PATH, and it didn't help. Unsure why I'm missing that .so (which by its name seems important!), but python 3.9 seems to work generally, and I don't see how I get past that issue to get ai-edge-tool running on python 3.9.
I was unfamiliar with pyenv (as used in one of the 3.9 solutions), using update-alternatives for my python version management, but it turns out to be useful(ish) for getting python 3.11 onto my Ubuntu 20.04 WSL @pkgoogle. 20.04 doesn't have 3.11 available through normal package managers, but pyenv is kind of able to install it, but then I'm having to install a bunch of other things first (and re-install) to get it to work properly. I've got far enough that it now seems to be having issues with what I'm trying to convert rather than the tool (hopefully just need to install more 3.11 libraries), but I've had to shelve it until next week to get on with other things. Python library-wise I only seemed to need to add timm after the requirements (and now project-specific things, but that's on me).
That's a progress update - I'll get back if I succeed with 3.11 / hit other issues. If there's something else I should have done for 3.9, please say.
Hi @BmanClark, as @chunnienc said please follow the 2nd process. It seems that the .so library isn't included by default on Ubuntu WSL2 when installing python. I think you will be able to install it with this:
sudo apt-get install python3.11-dev
or
sudo apt-get install python3.9-dev
If reinstalling either version:
sudo apt-get install python3.11
sudo apt-get install python3.11-dev
or
sudo apt-get install python3.9
sudo apt-get install python3.9-dev
I was able to reproduce your issue and fix it with the above by testing on a consumer Windows Setup. Let us know if somehow it still doesn't work for you. Thanks.
Description of the bug:
Attempt 1
Initially I tried to just install ai-edge-torch and its dependencies on a clean python 3.9 as needed rather than thru a virtual environment + requirements.txt. In this case I had issues with it wanting to install a particular version of torch_xla. The latest available version gives me:
ImportError: WRONG PACKAGE. Please install the package from Neuron Repository - [pip.repos.neuron.amazonaws.com](http://pip.repos.neuron.amazonaws.com/)
but if I try and install from that repository it says:WARNING: Url '[pip.repos.neuron.amazonaws.com/torch-xla/](http://pip.repos.neuron.amazonaws.com/torch-xla/)' is ignored. It is either a non-existing path or lacks a specific scheme.
I can see the path if I go to the location, so it exists, but fails to be recognised as a repository. So that failed.Attempt 2
Following your current front page instruction with the virtual env + requirements, when doing
pip install -r https://github.com/google-ai-edge/ai-edge-torch/releases/download/v0.1.1/requirements.txt
I get errors:pip install gast
tells me gast is in fact installed, andpip install ai-edge-torch==0.1.1
works. However, when trying to use it I initially get errors about numpy version (as per above, it has installed 2.0). Installing numpy 1.26 fixes these, but then I hit:Actual vs expected behavior:
Hits an error rather than completing and giving a converted model.
Any other information you'd like to share?
I'm on Ubuntu WSL2 within Windows, but generally that works for most things including any python tasks.