diff --git a/.train_pytorch_modelParallel.py.swp b/.train_pytorch_modelParallel.py.swp new file mode 100644 index 0000000..361aaf7 Binary files /dev/null and b/.train_pytorch_modelParallel.py.swp differ diff --git a/data/FashionMNIST/raw/t10k-images-idx3-ubyte b/data/FashionMNIST/raw/t10k-images-idx3-ubyte new file mode 100644 index 0000000..37bac79 Binary files /dev/null and b/data/FashionMNIST/raw/t10k-images-idx3-ubyte differ diff --git a/data/FashionMNIST/raw/t10k-images-idx3-ubyte.gz b/data/FashionMNIST/raw/t10k-images-idx3-ubyte.gz new file mode 100644 index 0000000..667844f Binary files /dev/null and b/data/FashionMNIST/raw/t10k-images-idx3-ubyte.gz differ diff --git a/data/FashionMNIST/raw/t10k-labels-idx1-ubyte b/data/FashionMNIST/raw/t10k-labels-idx1-ubyte new file mode 100644 index 0000000..2195a4d Binary files /dev/null and b/data/FashionMNIST/raw/t10k-labels-idx1-ubyte differ diff --git a/data/FashionMNIST/raw/t10k-labels-idx1-ubyte.gz b/data/FashionMNIST/raw/t10k-labels-idx1-ubyte.gz new file mode 100644 index 0000000..abdddb8 Binary files /dev/null and b/data/FashionMNIST/raw/t10k-labels-idx1-ubyte.gz differ diff --git a/data/FashionMNIST/raw/train-images-idx3-ubyte b/data/FashionMNIST/raw/train-images-idx3-ubyte new file mode 100644 index 0000000..ff2f5a9 Binary files /dev/null and b/data/FashionMNIST/raw/train-images-idx3-ubyte differ diff --git a/data/FashionMNIST/raw/train-images-idx3-ubyte.gz b/data/FashionMNIST/raw/train-images-idx3-ubyte.gz new file mode 100644 index 0000000..e6ee0e3 Binary files /dev/null and b/data/FashionMNIST/raw/train-images-idx3-ubyte.gz differ diff --git a/data/FashionMNIST/raw/train-labels-idx1-ubyte b/data/FashionMNIST/raw/train-labels-idx1-ubyte new file mode 100644 index 0000000..30424ca Binary files /dev/null and b/data/FashionMNIST/raw/train-labels-idx1-ubyte differ diff --git a/data/FashionMNIST/raw/train-labels-idx1-ubyte.gz b/data/FashionMNIST/raw/train-labels-idx1-ubyte.gz new file mode 100644 index 0000000..9c4aae2 Binary files /dev/null and b/data/FashionMNIST/raw/train-labels-idx1-ubyte.gz differ diff --git a/train_pytorch_modelParallel.py b/train_pytorch_modelParallel.py index b221de8..df0cd61 100644 --- a/train_pytorch_modelParallel.py +++ b/train_pytorch_modelParallel.py @@ -42,7 +42,7 @@ def train(model, train_loader, loss_function, optimizer, num_epochs): for i ,(images,labels) in enumerate(train_loader): images = torch.div(images, 255.) - images, labels = images.to(device), labels.to(device) +# images, labels = images.to(device), labels.to(device) optimizer.zero_grad() outputs = model(images) @@ -70,9 +70,9 @@ def train(model, train_loader, loss_function, optimizer, num_epochs): if not torch.cuda.is_available(): sys.exit("A minimum of 2 GPUs must be available to train this model.") -print("Training on device: ", device) +#print("Training on device: ", device) my_net = SeqNet(input_size, hidden_size1, output_size) -my_net = my_net.to(device) +#my_net = my_net.to(device) optimizer = torch.optim.Adam( my_net.parameters(), lr=lr) @@ -86,6 +86,7 @@ def train(model, train_loader, loss_function, optimizer, num_epochs): train(my_net, fmnist_train_loader, loss_function, optimizer, num_epochs) +""" correct = 0 total = 0 for images,labels in fmnist_test_loader: @@ -96,5 +97,5 @@ def train(model, train_loader, loss_function, optimizer, num_epochs): _, predicted = torch.max(output,1) correct += (predicted == labels).sum() total += labels.size(0) - print('Accuracy of the model: %.3f %%' %((100*correct)/(total+1))) +""" diff --git a/tutorials/model-parallel.md b/tutorials/model-parallel.md index 91f295e..35ae72f 100644 --- a/tutorials/model-parallel.md +++ b/tutorials/model-parallel.md @@ -50,7 +50,6 @@ def train(model, train_loader, loss_function, optimizer, num_epochs): for i ,(images,labels) in enumerate(train_loader): images = torch.div(images, 255.) - images, labels = images.to(device), labels.to(device) optimizer.zero_grad() outputs = model(images) @@ -81,7 +80,6 @@ lr = 0.01 if not torch.cuda.is_available(): sys.exit("A minimum of 2 GPUs must be available to train this model.") -print("Training on device: ", device) my_net = SeqNet(input_size, hidden_size1, output_size) optimizer = torch.optim.Adam( my_net.parameters(), lr=lr)