697 B
697 B
Pytorch
Run a docker container
This container runs in background
docker run -d -it --gpus all -name pytorch-container pytorch/pytorch:latest
Connect to running container
docker exec -it <container-name> bash
docker exec -it <container-name> bash -c "cat aap"
Stop and start an execistion container
docker stop <container-name>
docker start <container-name>
Example code
# Load libraries
import torch
import torch.nn as nn
from res.plot_lib import set_default, show_scatterplot, plot_bases
from matplotlib.pyplot import plot, title, axis
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")