tutoriais:conda
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| tutoriais:conda [2022-09-27 13:14] – created gnann | tutoriais:conda [2024-04-16 19:33] (current) – [Torch] gnann | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| <code bash> | <code bash> | ||
| # criar um diretório preferencialmente fora da $HOME (e.g. / | # criar um diretório preferencialmente fora da $HOME (e.g. / | ||
| + | |||
| + | # instalar o ambiente | ||
| conda create -y -p / | conda create -y -p / | ||
| + | |||
| + | # pode ser necessário ativar o conda no shell (e.g. bash) | ||
| + | # nesse caso recomendamos recarregar o .bashrc | ||
| + | conda init bash | ||
| + | |||
| + | # acessar o ambiente | ||
| + | conda activate / | ||
| + | |||
| + | # sair do ambiente | ||
| + | conda deactivate | ||
| </ | </ | ||
| + | |||
| + | ===== Tensorflow ===== | ||
| + | <code bash> | ||
| + | # DISCLAIMER: versão 2.4 ! | ||
| + | conda install tensorflow-gpu numpy=1.23 | ||
| + | </ | ||
| + | |||
| + | <code python> | ||
| + | import tensorflow as tf | ||
| + | cuda_version = tf.sysconfig.get_build_info()[" | ||
| + | gpu = tf.test.gpu_device_name() | ||
| + | |||
| + | print(" | ||
| + | print(" | ||
| + | </ | ||
| + | |||
| + | ===== Torch ===== | ||
| + | <code bash> | ||
| + | # python do sistema | ||
| + | conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia | ||
| + | </ | ||
| + | |||
| + | <code python> | ||
| + | import torch | ||
| + | |||
| + | print(" | ||
| + | print(" | ||
| + | </ | ||
| + | |||
| + | https:// | ||
tutoriais/conda.1664295242.txt.gz · Last modified: by gnann
