Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pytorch use multiple gpu

#easiest solution is to wrap you model in DataParallel like so:

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = Model(input_size, output_size)
if torch.cuda.device_count() > 1:
  print("Let's use", torch.cuda.device_count(), "GPUs!")
  model = nn.DataParallel(model)

model.to(device)
Comment

PREVIOUS NEXT
Code Example
Python :: clear python list 
Python :: python random word 
Python :: python datetime add one week 
Python :: select rows which entries equals one of the values pandas 
Python :: ValueError: Shapes (None, 1) and (None, 11) are incompatible keras 
Python :: docs.python.org 
Python :: flask render error template 
Python :: python number divisible by two other numbers 
Python :: initialize array of natural numbers python 
Python :: python counter least common 
Python :: dataframe print column comma separated 
Python :: pyspark case when 
Python :: popup window python tkinter 
Python :: python read zipfile 
Python :: post request python 
Python :: youtube upload python 
Python :: how to seperate words and number in a list 
Python :: nltk in python 
Python :: mean of torch tensor 
Python :: remove first 2 rows in pandas 
Python :: display video in jupyter notebook 
Python :: python copy dataframe 
Python :: how to create a new virtualenv 
Python :: get count of unique values in column pandas 
Python :: return max repeated value in list 
Python :: export pythonpath linux 
Python :: finding the index of an element in a pandas df 
Python :: connect with pyodbc with statement 
Python :: pandas dataframe scan column for values between numbers 
Python :: split a given number in python 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =