Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
doku:python [2023/08/08 11:46] – katrin | doku:python [2024/02/22 08:55] – katrin | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== (Conda) Quickstart ===== | ===== (Conda) Quickstart ===== | ||
- | To install a new environment start with creating an environment yaml file and store it in a safe location (ideally in your source code repository). This step is optional but we really recommend it so you and everyone in your team is able to produce the same python environment. | + | To install a new environment, start with creating an **environment yaml file** and store it in a safe location (ideally in your source code repository). |
+ | |||
+ | This step is optional but we really recommend it so you and everyone in your team is able to produce the same python environment. | ||
+ | |||
+ | To find valid conda package names look at [[https:// | ||
+ | |||
+ | Example (add your own packages below dependencies): | ||
< | < | ||
name: my-env | name: my-env | ||
+ | channels: | ||
+ | - conda-forge | ||
+ | - defaults | ||
dependencies: | dependencies: | ||
- python=3.10 | - python=3.10 | ||
- | - tensorflow-gpu=2.6.0 | + | - tensorflow=2.15.0 |
</ | </ | ||
- | Afterwards you can then use conda like this: | + | You can the install your environment by using the following commands: |
< | < | ||
Line 60: | Line 69: | ||
python --version | python --version | ||
</ | </ | ||
+ | |||
+ | ==== More info about Conda ==== | ||
+ | |||
+ | For more information about conda check-out the conda notebook of the python4HPC training material: [[https:// | ||
==== FAQ ==== | ==== FAQ ==== | ||
Line 210: | Line 223: | ||
>>> | >>> | ||
>>> | >>> | ||
+ | </ | ||
+ | |||
+ | === Pytorch === | ||
+ | |||
+ | To install the latest pytorch with conda please follow the instructions on this page: | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | For older and specific combinations of pytorch and cuda please have a look at this page: | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | Eg.: to install v1.13.1 with cuda 11.6 use: | ||
+ | < | ||
+ | conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia | ||
+ | </ | ||
+ | |||
+ | |||
+ | As of 2023-08-25: you can also install the current pytorch version with an older cuda version via: | ||
+ | < | ||
+ | conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c nvidia | ||
</ | </ | ||