User Tools

Site Tools


tutoriais:conda

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutoriais:conda [2022-09-27 13:14] – created gnanntutoriais: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. /var/tmp/foo/bar) # criar um diretório preferencialmente fora da $HOME (e.g. /var/tmp/foo/bar)
 +
 +# instalar o ambiente
 conda create -y -p /var/tmp/foo/bar python=3.6 conda create -y -p /var/tmp/foo/bar python=3.6
 +
 +# 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 /var/tmp/foo/bar
 +
 +# sair do ambiente
 +conda deactivate
 </code> </code>
 +
 +===== Tensorflow =====
 +<code bash>
 +# DISCLAIMER: versão 2.4 !
 +conda install tensorflow-gpu numpy=1.23
 +</code>
 +
 +<code python>
 +import tensorflow as tf
 +cuda_version = tf.sysconfig.get_build_info()["cuda_version"]
 +gpu = tf.test.gpu_device_name()
 +
 +print("GPU: "+gpu)
 +print("cuda: "+cuda_version)
 +</code>
 +
 +===== Torch =====
 +<code bash>
 +# python do sistema
 +conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
 +</code>
 +
 +<code python>
 +import torch
 +
 +print("gpu: "+torch.cuda.get_device_name(0))
 +print("cuda: "+torch.version.cuda)
 +</code>
 +
 +https://pytorch.org/get-started/locally/
tutoriais/conda.1664295242.txt.gz · Last modified: 2022-09-27 13:14 by gnann

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki