Pytorch installation error

Hi ,
i have upgrade my cuda from 11,4 to 12.2 using the following steps:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/arm64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda
sudo gedit ~/.bashrc
export PATH=/usr/local/cuda-12.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.2/${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
source ~/.bashrc

after that i am ablr=e to clone the pytorch using the following steps:

git clone --recursive --branch v2.1.1 http://github.com/pytorch/pytorch
export USE_NCCL=0 && \
export USE_QNNPACK=0 && \
export USE_PYTORCH_QNNPACK=0 && \
export USE_CUDA=1 & \
export USE_NATIVE_ARCH=1 && \
export USE_DISTRIBUTED=1 && \
export USE_TENSORRT=0 && \
export TORCH_CUDA_ARCH_LIST="8.7" 

export PYTORCH_BUILD_VERSION=2.1.1 && \
export PYTORCH_BUILD_NUMBER=1
cd pytorch
pip install -U -r requirements.txt
pip install -U scikit-build
pip install -U ninja
sudo apt remove cmake -y
pip install cmake --upgrade
export TORCH_CUDA_ARCH_LIST="8.7"
python setup.py bdist_wheel 

but when i am trying to clone torchvision
git clone --branch v0.16.1 https://github.com/pytorch/vision torchvision   # see below for version of torchvision to download
cd torchvision
export BUILD_VERSION=0.16.1 # where 0.x.0 is the torchvision version  
export TORCH_CUDA_ARCH_LIST="8.7"
python setup.py bdist_wheel

i am getting error that no module named torch .

What machine is it? Jetson? (since i saw arm64, I am assuming it is unless I am wrong)
If it is Jetson, do not upgrade your CUDA version that way or in any way.
It is not supposed to be upgraded.

i have upgraded it from 11.4 to 12.2 nd i am able to install pytorch also but dnt know whether it is cuda version or not and also my system got slow after that could you please suggest me something

What is your system environment?
What device? Jetson or x86?
Give a bit more information please.

If it is jetson, you can upgrade it upto 11.8. (Although I have never tried it)
Refer these links

jetson arm64

So your Jetpack must be 5.1.1 or 5.1.2

As you can see in that link, the default cuda version is 11.4 and the max you can do is 11.8.

Please refer to those sites when upgrading your cuda version.

hi,
yes i have installed jetpack 5.1.2 , nd default version is 11.4 ,but i didnt find how to install pytorch for cuda11.4 on nvidia documentation

Hi @sidhu.rana34, for Jetson related topics I highly recommend the dedicated Jetson categories.

If you tell us which model exactly you are using, I can point you to the correct sub-forum.

Thanks!

@sidhu.rana34 Hi
I believe this link will help you.
For any kind of installation on jetson, you will probably find an answer in this nvidia developer forum.

This link shows Pytorch v2.1.0:
for jetpack 5.1, 5.1.1 and 5.1.2

I believe this link can also help you alot for pytorch installation.

for torchvision if you ever want to do it, follow the first link again or keep searching for it in the forum, you’ll find something.

Hi , i am going to use yolov7 model

That came out of nowhere but you’ll find tons of guides and tutorials and github links related to yolov7 or any yolo version on a jetson, be it tensorrt (c++ or python) or tensorrt with deepstream.

I hope you can do your pytorch installation.

Thanks.