Issue
I would like to add lines for torch
and torchvision
on my requirements.txt file, to allow for easy clone, and I will be moving from computer to computer and to cloud in the near future.
I want an easy pip install -r requirements.txt
and be done with it for my project.
> pip freeze > requirements.txt
gives something like
...
torch==1.5.0
torchvision==0.6.0
...
However, pip install -r requirements.txt
(which is in fact pip install torch
) doesn't work, and instead, as the official torch site, clearly says the command should be:
pip install torch===1.5.0 torchvision===0.6.0 -f https://download.pytorch.org/whl/torch_stable.html
How do I make the requirements file reflect this?
My desktop is Windows 10.
Bonus question:
My cloud is Linux based.
How do I make the requirements file fit both desktop and cloud?
Solution
You can use the same options in your requirements.txt
file, e.g.
torch===1.5.0
torchvision===0.6.0
-f https://download.pytorch.org/whl/torch_stable.html
Then simply run pip install -r requirements.txt
Answered By - michaeldel Answer Checked By - Katrina (WPSolving Volunteer)