Closed giladcohen closed 1 year ago
Thanks for flagging this issue! We will take a look at this.
I found this workaround:
1) pip install --no-deps functorch
2) pip install opacus
The fix has finally been published, the problem should go away for opacus==1.4.0
Please reopen the issue if it doesn't
Hi, I am still facing some issues with installing Opacus 1.4.0 together with PyTorch 2.0.1 into the same conda environment.
Following the suggested installation command of PyTorch (https://pytorch.org/get-started/locally/), I create a new conda environment only with PyTorch 2.0.1 but without Opacus via
conda create -n pt20-pure pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
In particular, this will pull the following pytorch-related packages, as expected:
pytorch pytorch/win-64::pytorch-2.0.1-py3.11_cuda11.8_cudnn8_0
pytorch-cuda pytorch/win-64::pytorch-cuda-11.8-h24eeafa_5
torchaudio pytorch/win-64::torchaudio-2.0.2-py311_cu118
torchvision pytorch/win-64::torchvision-0.15.2-py311_cu118
On the other hand, running a modified command that also installs Opacus 1.4.0 from conda-forge
via
conda create -n pt20-opacus pytorch torchvision torchaudio pytorch-cuda=11.8 "opacus>=1.4" -c pytorch -c nvidia -c conda-forge
will pull some outdated CPU-builds of the above packages, except the pytorch-cuda package:
pytorch pytorch/win-64::pytorch-1.13.1-py3.10_cpu_0
pytorch-cuda pytorch/win-64::pytorch-cuda-11.8-h24eeafa_5
torchaudio pytorch/win-64::torchaudio-0.13.1-py310_cpu
torchvision pytorch/win-64::torchvision-0.14.1-py310_cpu
Or does Opacus 1.4 still require PyTorch < 2.0? The release notes (https://github.com/pytorch/opacus/releases/tag/v1.4.0) say "Upgraded to PyTorch 1.13+ as required dependency", which strictly speaking would include PyTorch 2.x :). Also, the current requirements.txt on GitHub has a line "torch>=2.0" (but the latest commit to requirements.txt was after the release of Opacus 1.4.0).
Hey, dude, I'm facing the same problem as you. And my torch verison == 1.12.1+cu116
, which is older than 2.0
.
Upon calling
pip install opacus
pip is trying to delete my installed torch(GPU) version and install a CPU version instead.To Reproduce
This is what I got:
It seems that
functorch
is forcing a non cuda pytorch version. I experienced the same behavior also when I tried to install opacus for torch==1.12.1+cu113.I am using python vertion 3.7.9
Environment