Skip to content

Commit

Permalink
Removed scipy dependency. Apex is not optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDettmers committed Jul 11, 2019
1 parent 1d0d29f commit 7392eea
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
9 changes: 8 additions & 1 deletion mnist_cifar/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from sparselearning.models import AlexNet, VGG16, LeNet_300_100, LeNet_5_Caffe, WideResNet
from sparselearning.utils import get_mnist_dataloaders, get_cifar10_dataloaders

from apex.fp16_utils import FP16_Optimizer

cudnn.benchmark = True
cudnn.deterministic = True
Expand Down Expand Up @@ -134,6 +133,14 @@ def main():
sparselearning.core.add_sparse_args(parser)

args = parser.parse_args()

if args.fp16:
try:
from apex.fp16_utils import FP16_Optimizer
except:
print('WARNING: apex not installed, ignoring --fp16 option')
args.fp16 = False

use_cuda = not args.no_cuda and torch.cuda.is_available()
device = torch.device("cuda" if use_cuda else "cpu")

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
numpy
matplotlib
apex
2 changes: 1 addition & 1 deletion results/MNIST_sparse_summary.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Sparsity,Full Dense,error1,Dynamic Sparse,error2,Sparse Momentum,error3,SET,error4,DEEP-R,error5
0.99,0.9869,0.000106094,0.9754,0.000157,0.9753,0.000469515,0.958,0.000451
0.99,0.9869,0.000106094,0.9754,0.000157,0.9753,0.000469515,0.958,0.000451, 0.94, 0.0001
0.98,0.9869,0.000106094,0.9814,0.00064,0.982,0.00017966,0.9774096,0.0007068877551,0.9821,0.00135
0.97,0.9869,0.000106094,0.9820,0.00023,0.983,0.000546148,0.9806024,0.0003380612245,0.9822,0.000451
0.96,0.9869,0.000106094,0.9823,0.00023,0.9842,0.00023202,0.9809639,0.0003688265306,0.983,0.000574
Expand Down
1 change: 0 additions & 1 deletion sparselearning/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import torch.optim as optim
from torch.utils.data.sampler import SubsetRandomSampler

from scipy.sparse import coo_matrix, csr_matrix
import numpy as np
import math
import os
Expand Down

0 comments on commit 7392eea

Please sign in to comment.