Cannot use older torch version?

11 views
Skip to first unread message

Dinhosaur

unread,
Jan 30, 2022, 3:29:12 PM1/30/22
to conda - Public
Hi guys,

Can anyone please help me?
I am trying to run a .py script for which I need an older pytorch version, because a function I am using is deprecated in later torch versions.
But I seem not to be able to install it correctly.

I installed torch into my virtual environment using

conda create -n my_env python=3.6.2
source activate my_env

conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.2 -c pytorch


Then I have a python file (myfile.py) that I start from a shell file (start.sh).

start.sh
source activate my_env
srun --unbuffered python myfile.py

myfile.py
import torch
print(torch.__version__)

The print command from myfile.py still returns "1.8.0"
.
Am I doing something very obvious wrong possibly? Did I install in a wrong way, or is somehow my environment not properly loaded in the python file?

Best regards and thanks a lot in advance

Dinho
Reply all
Reply to author
Forward
0 new messages