aaron-xichen / pytorch-playground

Base pretrained models and datasets in pytorch (MNIST, SVHN, CIFAR10, CIFAR100, STL10, AlexNet, VGG16, VGG19, ResNet, Inception, SqueezeNet)
MIT License
2.6k stars 607 forks source link

gpu_set #52

Closed Thrill-Peng closed 3 years ago

Thrill-Peng commented 3 years ago

Traceback (most recent call last): File "/home/p/Work/pytorch-playground-master/quantize.py", line 102, in main() File "/home/p/Work/pytorch-playground-master/quantize.py", line 31, in main args.gpu = misc.auto_select_gpu(utility_bound=0, num_gpu=args.ngpu, selected_gpus=args.gpu) File "/home/p/Work/pytorch-playground-master/utee/misc.py", line 88, in auto_select_gpu selected_gpus = selected_gpus.split(',') AttributeError: 'int' object has no attribute 'split'

parser.add_argument('--gpu', default=1, help='index of gpus to use')
if default=1,the error will be appear if default=1,the another error as fllows:

type: vgg16 quant_method: linear batch_size: 24 gpu: ['1'] ngpu: 1 seed: 117 model_root: /home/p/.torch/models data_root: /home/p/Work/pytorch-playground-master/data/train logdir: log/default input_size: 1024 n_sample: 20 param_bits: 8 bn_bits: 32 fwd_bits: 8 overflow_rate: 0.0

Setting GPU: ['1'] Traceback (most recent call last): File "/home/p/Work/pytorch-playground-master/quantize.py", line 102, in main() File "/home/p/Work/pytorch-playground-master/quantize.py", line 43, in main assert torch.cuda.is_available(), 'no cuda' AssertionError: no cuda

what should i do?