Base pretrained models and datasets in pytorch (MNIST, SVHN, CIFAR10, CIFAR100, STL10, AlexNet, VGG16, VGG19, ResNet, Inception, SqueezeNet)

Overview

This is a playground for pytorch beginners, which contains predefined models on popular dataset. Currently we support

  • mnist, svhn
  • cifar10, cifar100
  • stl10
  • alexnet
  • vgg16, vgg16_bn, vgg19, vgg19_bn
  • resnet18, resnet34, resnet50, resnet101, resnet152
  • squeezenet_v0, squeezenet_v1
  • inception_v3

Here is an example for MNIST dataset. This will download the dataset and pre-trained model automatically.

import torch
from torch.autograd import Variable
from utee import selector
model_raw, ds_fetcher, is_imagenet = selector.select('mnist')
ds_val = ds_fetcher(batch_size=10, train=False, val=True)
for idx, (data, target) in enumerate(ds_val):
    data =  Variable(torch.FloatTensor(data)).cuda()
    output = model_raw(data)

Also, if want to train the MLP model on mnist, simply run python mnist/train.py

Install

python3 setup.py develop --user

ImageNet dataset

We provide precomputed imagenet validation dataset with 224x224x3 size. We first resize the shorter size of image to 256, then we crop 224x224 image in the center. Then we encode the cropped images to jpg string and dump to pickle.

Quantization

We also provide a simple demo to quantize these models to specified bit-width with several methods, including linear method, minmax method and non-linear method.

quantize --type cifar10 --quant_method linear --param_bits 8 --fwd_bits 8 --bn_bits 8 --ngpu 1

Top1 Accuracy

We evaluate the performance of popular dataset and models with linear quantized method. The bit-width of running mean and running variance in BN are 10 bits for all results. (except for 32-float)

Model 32-float 12-bit 10-bit 8-bit 6-bit
MNIST 98.42 98.43 98.44 98.44 98.32
SVHN 96.03 96.03 96.04 96.02 95.46
CIFAR10 93.78 93.79 93.80 93.58 90.86
CIFAR100 74.27 74.21 74.19 73.70 66.32
STL10 77.59 77.65 77.70 77.59 73.40
AlexNet 55.70/78.42 55.66/78.41 55.54/78.39 54.17/77.29 18.19/36.25
VGG16 70.44/89.43 70.45/89.43 70.44/89.33 69.99/89.17 53.33/76.32
VGG19 71.36/89.94 71.35/89.93 71.34/89.88 70.88/89.62 56.00/78.62
ResNet18 68.63/88.31 68.62/88.33 68.49/88.25 66.80/87.20 19.14/36.49
ResNet34 72.50/90.86 72.46/90.82 72.45/90.85 71.47/90.00 32.25/55.71
ResNet50 74.98/92.17 74.94/92.12 74.91/92.09 72.54/90.44 2.43/5.36
ResNet101 76.69/93.30 76.66/93.25 76.22/92.90 65.69/79.54 1.41/1.18
ResNet152 77.55/93.59 77.51/93.62 77.40/93.54 74.95/92.46 9.29/16.75
SqueezeNetV0 56.73/79.39 56.75/79.40 56.70/79.27 53.93/77.04 14.21/29.74
SqueezeNetV1 56.52/79.13 56.52/79.15 56.24/79.03 54.56/77.33 17.10/32.46
InceptionV3 76.41/92.78 76.43/92.71 76.44/92.73 73.67/91.34 1.50/4.82

Note: ImageNet 32-float models are directly from torchvision

Selected Arguments

Here we give an overview of selected arguments of quantize.py

Flag Default value Description & Options
type cifar10 mnist,svhn,cifar10,cifar100,stl10,alexnet,vgg16,vgg16_bn,vgg19,vgg19_bn,resent18,resent34,resnet50,resnet101,resnet152,squeezenet_v0,squeezenet_v1,inception_v3
quant_method linear quantization method:linear,minmax,log,tanh
param_bits 8 bit-width of weights and bias
fwd_bits 8 bit-width of activation
bn_bits 32 bit-width of running mean and running vairance
overflow_rate 0.0 overflow rate threshold for linear quantization method
n_samples 20 number of samples to make statistics for activation
Comments
  • Encounter

    Encounter "Memory Error" when converting imagenet dataset

    Hi, When I was trying to using the Alexnet model, I first of all tried to follow your instruction to download val224_compressed.pkl and executed the command "python convert.py" But when I was converting, it always come to the error message "Memory Error". I am curious about how to deal with this issue, since I think the memory of the machine I used is big enough, which is 64 GB. Thanks !

    opened by jeff830107 4
  • Access quantized weights

    Access quantized weights

    I have been trying to access the quantized weights, but the quant layer has no attribute 'weight'. Looking at the code, I think that the quant layer only quantizes the input (i.e. the result of previous layers) in the forward pass, and not the weights of layers which I want quantized. Is there any workaround for this?

    opened by amnamasood 4
  • Quantization for forward activations is ignored for inception_v3 torchvision model

    Quantization for forward activations is ignored for inception_v3 torchvision model

    Thanks a lot for this nice utility to test quantization on pretrained models!

    I'm trying to quantize the pretrained inception_v3 (directly from torchvision) by running the quantize.py script after minor modifications (to support external models).

    From the code I see that the quant.duplicate_model_with_quant() function expects the model to contain a nn.Sequential block:

    if isinstance(model, nn.Sequential):
        <add quantizer blocks after usual ops>
    

    Since the torchvision inception_v3 model doesn't contain nn.Sequential, no _quant layers are not added in the final quantized model.

    I wanted to understand what would be a clean fix retaining generality without losing the functionality you intended to keep by checking for nn.Sequential?

    As of now, I'm just bypassing the if statement, but I presume that would add _quant blocks blindly to everything.

    Output as it is:

    DataParallel(
      (module): Inception3(
        (Conv2d_1a_3x3): BasicConv2d(
          (conv): Conv2d (3, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)
          (bn): BatchNorm2d(32, eps=0.001, momentum=0.1, affine=True)
        )
    ...
    

    Output with if statement bypassed:

    Sequential(
      (module): Sequential(
        (Conv2d_1a_3x3): Sequential(
          (conv): Conv2d (3, 32, kernel_size=(3, 3), stride=(2, 2), bias=False)
          (conv_linear_quant): LinearQuant(sf=None, bits=8, overflow_rate=0.000, counter=50)
          (bn): BatchNorm2d(32, eps=0.001, momentum=0.1, affine=True)
          (bn_linear_quant): LinearQuant(sf=None, bits=8, overflow_rate=0.000, counter=50)
        )
    ...
    
    opened by sjain-stanford 4
  • there is some trouble

    there is some trouble

    when I run python quantize.py --type cifar10 --quant_method linear --param_bits 8 --fwd_bits 8 --bn_bits 8 --gpu 0. It prints Traceback (most recent call last): File "quantize.py", line 64, in sf = bits - 1. - quant.compute_integral_part(v, overflow_rate=args.overflow_rate) File "/home/hjs/pytorch-playground-master/utee/quant.py", line 14, in compute_integral_part v = v.data.cpu().numpy()[0] IndexError: too many indices for array I am looking for your help

    opened by JensenHJS 3
  • The weight of conv is not quantized, right?

    The weight of conv is not quantized, right?

    From utee/quant.py, I can only find the process of adding quantized layer between different layer. But when it comes to quantized weight of conv, I can not find it. So I wonder why you do not quant weight of conv, because it is importance in process of quantification.

    opened by yongchaoding 3
  • Alexnet after minmax quantized

    Alexnet after minmax quantized

    python quantize.py --type alexnet --quant_method minmax --param_bits 8 --fwd_bits 8 --bn_bits 8 --ngpu 1

    type=alexnet, quant_method=minmax, param_bits=8, bn_bits=8, fwd_bits=8, overflow_rate=0.0, acc1=0.5514, acc5=0.7819

    print('save model...') torch.save(model_raw.state_dict(), 'model_quantized.pth') I am puzzled, after quantized, the model's memory are still 234M, how to save the quantied model? Thanks for your help.

    opened by RichardMrLu 3
  • cifar100 model url 404 not found

    cifar100 model url 404 not found

    model_urls = { 'cifar10': 'http://ml.cs.tsinghua.edu.cn/~chenxi/pytorch-models/cifar10-d875770b.pth', 'cifar100': 'http://ml.cs.tsinghua.edu.cn/~chenxi/pytorch-models/cifar100-3a55a987.pth', }

    model url 404 not found

    opened by yuchi1989 2
  • Activation quantization

    Activation quantization

    Is there any reason why quantization is only applied if the module is a Sequential module and not everywhere? As in, the only place where I can see the activation quantization to not have an effect is if we do quantization before and after (though I don't know if floating point stability will affect this).

    opened by AkashGanesan 2
  • Quantizing VGG-16

    Quantizing VGG-16

    I tried quantizing a VGG-16 network but the size of the network hasn't changed. I loaded a VGG-16 model from torchvision and ran a portion of the quantize.py (lines 48 - 79) which does the quantization. When I saved the model - the size had increased slightly.

    Can you please tell me what I am doing incorrectly?

    opened by indrajitsg 2
  • svhn with batch_size = 1

    svhn with batch_size = 1

    import torch
    from torch.autograd import Variable
    from utee import selector
    model_raw, ds_fetcher, is_imagenet = selector.select('svhn')
    ds_val = ds_fetcher(batch_size=1, train=False, val=True)
    for idx, (data, target) in enumerate(ds_val):
        data =  Variable(torch.FloatTensor(data)).cuda()
        output = model_raw(data)
        print(output.data.cpu().numpy())
        print(np.argmax(output.data.cpu().numpy()))
        print(target)
    

    @aaron-xichen I've tried this and the result was unsatisfactory ( it works fine for batch_size>1) The followings are some results.

    [[ 0.9298288 0.17785856 0.9966059 -1.3422316 -0.8245616 -1.9604906 -2.7374938 -1.6454206 -1.8076795 -2.0542176 ]] 2

    4 [torch.LongTensor of size 1]

    [[ 2.7919588 0.49071673 -0.00736207 -2.0971794 -0.84618115 -2.2232437 -1.6899112 -0.6246177 -2.9164875 -3.1203978 ]] 0

    1 [torch.LongTensor of size 1]

    [[ 2.9281554 -0.13904905 -1.3504897 -1.6061695 -2.2028518 -2.205429 -2.3030198 -1.7889079 -1.5594031 0.7322607 ]] 0

    0 [torch.LongTensor of size 1]

    [[ 1.6236477 -0.04049116 0.71252775 -1.5312613 -0.80628943 -1.1643314 -2.7663736 -1.779502 -1.764115 -2.6679206 ]] 0

    9 [torch.LongTensor of size 1]

    [[ 3.0169618 0.21566215 -0.64600635 -1.0604596 -2.5471652 -1.1154206 -3.167088 -1.7345388 -1.3325107 -1.2756087 ]] 0

    5 [torch.LongTensor of size 1]

    [[ 3.2620628 -1.1842312 -0.96141076 -0.72385985 -1.6753035 -0.01387847 -2.4336383 -2.6121674 -1.9076045 -2.078348 ]] 0

    0 [torch.LongTensor of size 1]

    [[ 3.155985 -0.25471076 -0.89448035 -0.77628857 -1.8204114 -3.392403 -2.5437825 -1.4555902 -1.0910527 -1.2623619 ]] 0

    8 [torch.LongTensor of size 1]

    [[ 2.4467583 -0.54981095 0.5102633 -1.2237269 -1.3451892 -2.4299471 -1.9993426 -1.2083414 0.04519886 -3.9493613 ]] 0

    0 [torch.LongTensor of size 1]

    [[ 3.0312405 0.00999061 -0.29210752 -1.6024964 -0.9401326 -1.0996346 -3.5482233 -0.65459347 -2.6797504 -2.7330062 ]] 0

    0 [torch.LongTensor of size 1]

    [[ 2.0508249 0.30808404 -0.6483562 -0.70096767 -1.3534812 -2.8651845 -2.9115884 -1.5140661 -0.58172 -1.2605368 ]] 0

    7 [torch.LongTensor of size 1]

    [[ 3.8504605 -1.934954 -0.1308189 -0.9230577 -1.7006387 -0.39881432 -3.0715973 -2.162218 -2.7872374 -1.0572728 ]] 0

    2 [torch.LongTensor of size 1]

    [[ 1.6195637 -2.3086352 -0.5728828 -0.86222374 0.429138 -0.6708926 -2.159588 -0.8012347 -2.1825366 -2.1155794 ]] 0

    5 [torch.LongTensor of size 1]

    [[ 1.5269842 -0.49805775 -0.44842458 -0.5922584 -2.7392595 -2.0895157 -1.2918607 -1.4767127 -1.2701623 -1.2878953 ]] 0

    4 [torch.LongTensor of size 1]

    [[ 1.8214152 -0.39846689 1.6661385 -0.7838743 -1.4924386 -1.0132811 -3.5224247 -1.7450149 -2.133103 -2.6991496 ]] 0

    0 [torch.LongTensor of size 1]

    [[ 3.3604963 -0.46506485 1.5834907 -3.2729144 -2.377539 -0.6647626 -3.1641421 -1.3123829 -1.9374268 -1.6866504 ]] 0

    3 [torch.LongTensor of size 1]

    [[ 1.7083087 1.0932902 -0.30605602 -0.89276785 -1.7285749 -1.6361132 -3.7625558 -1.6642044 -0.58260405 -2.6053936 ]] 0

    3 [torch.LongTensor of size 1]

    [[ 1.1230315 1.3429782 -0.7060108 -2.4044423 -1.0088397 -1.5541636 -0.94885933 -1.4849153 -1.6033367 -2.5828755 ]] 1

    0 [torch.LongTensor of size 1]

    [[ 1.9963155 -0.16534638 0.46809655 -1.1736008 -2.8804379 -0.66240954 -2.0466976 -2.3514454 -0.99034363 -1.7793173 ]] 0

    5 [torch.LongTensor of size 1]

    [[ 2.2264035 0.34485406 0.73350465 -1.9414191 -1.8649687 -3.4865122 -1.9899611 -1.1546313 -0.43400905 -2.308626 ]] 0

    2 [torch.LongTensor of size 1]

    opened by sungyoon-lee 2
  • the interger bits and mantissa bits after log min max quantize

    the interger bits and mantissa bits after log min max quantize

    I do not understand the log min max quantize quite well. can you explain which bits are interger part and which are mantissa part after log min max quantize? How can i get the interger representation of the quantized number? Thank you so much.

    opened by zhangying0127 2
  • Bump pillow from 6.1 to 9.3.0

    Bump pillow from 6.1 to 9.3.0

    Bumps pillow from 6.1 to 9.3.0.

    Release notes

    Sourced from pillow's releases.

    9.3.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.3.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.3.0 (2022-10-29)

    • Limit SAMPLESPERPIXEL to avoid runtime DOS #6700 [wiredfool]

    • Initialize libtiff buffer when saving #6699 [radarhere]

    • Inline fname2char to fix memory leak #6329 [nulano]

    • Fix memory leaks related to text features #6330 [nulano]

    • Use double quotes for version check on old CPython on Windows #6695 [hugovk]

    • Remove backup implementation of Round for Windows platforms #6693 [cgohlke]

    • Fixed set_variation_by_name offset #6445 [radarhere]

    • Fix malloc in _imagingft.c:font_setvaraxes #6690 [cgohlke]

    • Release Python GIL when converting images using matrix operations #6418 [hmaarrfk]

    • Added ExifTags enums #6630 [radarhere]

    • Do not modify previous frame when calculating delta in PNG #6683 [radarhere]

    • Added support for reading BMP images with RLE4 compression #6674 [npjg, radarhere]

    • Decode JPEG compressed BLP1 data in original mode #6678 [radarhere]

    • Added GPS TIFF tag info #6661 [radarhere]

    • Added conversion between RGB/RGBA/RGBX and LAB #6647 [radarhere]

    • Do not attempt normalization if mode is already normal #6644 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Load pretrained model on CPU only machine

    Load pretrained model on CPU only machine

    I tried to load pretrained MNIST model on a CPU only machine, however, I met

    RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU.

    So I added a parameter cuda with a default value True when creating models. This parameter is only used when loading pretrained models from model_zoo.

    When load model from model_zoo.load_url, I set the map_location to "cuda" if cuda=True in the parameter, else "cpu"

    map_location (optional) – a function or a dict specifying how to remap storage locations (see torch.load)

    from https://pytorch.org/docs/stable/model_zoo.html

    opened by boyang9602 0
  • Bump joblib from 0.14.1 to 1.2.0

    Bump joblib from 0.14.1 to 1.2.0

    Bumps joblib from 0.14.1 to 1.2.0.

    Changelog

    Sourced from joblib's changelog.

    Release 1.2.0

    • Fix a security issue where eval(pre_dispatch) could potentially run arbitrary code. Now only basic numerics are supported. joblib/joblib#1327

    • Make sure that joblib works even when multiprocessing is not available, for instance with Pyodide joblib/joblib#1256

    • Avoid unnecessary warnings when workers and main process delete the temporary memmap folder contents concurrently. joblib/joblib#1263

    • Fix memory alignment bug for pickles containing numpy arrays. This is especially important when loading the pickle with mmap_mode != None as the resulting numpy.memmap object would not be able to correct the misalignment without performing a memory copy. This bug would cause invalid computation and segmentation faults with native code that would directly access the underlying data buffer of a numpy array, for instance C/C++/Cython code compiled with older GCC versions or some old OpenBLAS written in platform specific assembly. joblib/joblib#1254

    • Vendor cloudpickle 2.2.0 which adds support for PyPy 3.8+.

    • Vendor loky 3.3.0 which fixes several bugs including:

      • robustly forcibly terminating worker processes in case of a crash (joblib/joblib#1269);

      • avoiding leaking worker processes in case of nested loky parallel calls;

      • reliability spawn the correct number of reusable workers.

    Release 1.1.0

    • Fix byte order inconsistency issue during deserialization using joblib.load in cross-endian environment: the numpy arrays are now always loaded to use the system byte order, independently of the byte order of the system that serialized the pickle. joblib/joblib#1181

    • Fix joblib.Memory bug with the ignore parameter when the cached function is a decorated function.

    ... (truncated)

    Commits
    • 5991350 Release 1.2.0
    • 3fa2188 MAINT cleanup numpy warnings related to np.matrix in tests (#1340)
    • cea26ff CI test the future loky-3.3.0 branch (#1338)
    • 8aca6f4 MAINT: remove pytest.warns(None) warnings in pytest 7 (#1264)
    • 067ed4f XFAIL test_child_raises_parent_exits_cleanly with multiprocessing (#1339)
    • ac4ebd5 MAINT add back pytest warnings plugin (#1337)
    • a23427d Test child raises parent exits cleanly more reliable on macos (#1335)
    • ac09691 [MAINT] various test updates (#1334)
    • 4a314b1 Vendor loky 3.2.0 (#1333)
    • bdf47e9 Make test_parallel_with_interactively_defined_functions_default_backend timeo...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump opencv-python from 4.1.2.30 to 4.2.0.32

    Bump opencv-python from 4.1.2.30 to 4.2.0.32

    Bumps opencv-python from 4.1.2.30 to 4.2.0.32.

    Release notes

    Sourced from opencv-python's releases.

    4.2.0.32

    OpenCV version 4.2.0.

    Changes:

    • macOS environment updated from xcode8.3 to xcode 9.4
    • macOS uses now Qt 5 instead of Qt 4
    • Nasm version updated to Docker containers
    • multibuild updated

    Fixes:

    • don't use deprecated brew tap-pin, instead refer to the full package name when installing #267
    • replace get_config_var() with get_config_vars() in setup.py #274
    • add workaround for DLL errors in Windows Server #264
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • The low accuracy of CIFAR100

    The low accuracy of CIFAR100

    Hi, thanks for sharing the code. I run the training scripts of CIFAR100 but only get an accuracy of 66% (without quantization), instead of 74%. Can you please provide the parameter setting of the training script?

    Thanks,

    opened by ziqi-zhang 1
  • The accuracy error

    The accuracy error

    Thank you for you share, but when i run like below, i get result :acc1=0.00 acc5=0.00 ''python quantize.py --type cifar10 --quant_method linear --param_bits 16 --fwd_bits 16 --bn_bits 16 --gpu 0 --ngpu 1 --input_size 32''

    The first time I run, I get the following error, ''...not supported on CUDAType for Long''

    then I change the data type to float, and then I get the above result. Thank you or your help.

    opened by louvinci 1
Owner
Aaron Chen
Aaron Chen
Cancer-and-Tumor-Detection-Using-Inception-model - In this repo i am gonna show you how i did cancer/tumor detection in lungs using deep neural networks, specifically here the Inception model by google.

Cancer-and-Tumor-Detection-Using-Inception-model In this repo i am gonna show you how i did cancer/tumor detection in lungs using deep neural networks

Deepak Nandwani 1 Jan 1, 2022
Implementation of Squeezenet in pytorch, pretrained models on Cifar 10 data to come

Pytorch Squeeznet Pytorch implementation of Squeezenet model as described in https://arxiv.org/abs/1602.07360 on cifar-10 Data. The definition of Sque

gaurav pathak 86 Oct 28, 2022
NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

null 5 Nov 3, 2022
Everything you want about DP-Based Federated Learning, including Papers and Code. (Mechanism: Laplace or Gaussian, Dataset: femnist, shakespeare, mnist, cifar-10 and fashion-mnist. )

Differential Privacy (DP) Based Federated Learning (FL) Everything about DP-based FL you need is here. (所有你需要的DP-based FL的信息都在这里) Code Tip: the code o

wenzhu 83 Dec 24, 2022
Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Matthias Wright 169 Dec 26, 2022
Pretrained models for Jax/Haiku; MobileNet, ResNet, VGG, Xception.

Pre-trained image classification models for Jax/Haiku Jax/Haiku Applications are deep learning models that are made available alongside pre-trained we

Alper Baris CELIK 14 Dec 20, 2022
StyleTransfer - Open source style transfer project, based on VGG19

StyleTransfer - Open source style transfer project, based on VGG19

Patrick martins de lima 9 Dec 13, 2021
Official pytorch implementation of paper "Inception Convolution with Efficient Dilation Search" (CVPR 2021 Oral).

IC-Conv This repository is an official implementation of the paper Inception Convolution with Efficient Dilation Search. Getting Started Download Imag

Jie Liu 111 Dec 31, 2022
An image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testingAn image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testing

SVM Données Une base d’images contient 490 images pour l’apprentissage (400 voitures et 90 bateaux), et encore 21 images pour fait des tests. Prétrait

Achraf Rahouti 3 Nov 30, 2021
A PyTorch Image-Classification With AlexNet And ResNet50.

PyTorch 图像分类 依赖库的下载与安装 在终端中执行 pip install -r -requirements.txt 完成项目依赖库的安装 使用方式 数据集的准备 STL10 数据集 下载:STL-10 Dataset 存储位置:将下载后的数据集中 train_X.bin,train_y.b

FYH 4 Feb 22, 2022
Quickly comparing your image classification models with the state-of-the-art models (such as DenseNet, ResNet, ...)

Image Classification Project Killer in PyTorch This repo is designed for those who want to start their experiments two days before the deadline and ki

null 349 Dec 8, 2022
Diverse Branch Block: Building a Convolution as an Inception-like Unit

Diverse Branch Block: Building a Convolution as an Inception-like Unit (PyTorch) (CVPR-2021) DBB is a powerful ConvNet building block to replace regul

null 253 Dec 24, 2022
A simple rest api serving a deep learning model that classifies human gender based on their faces. (vgg16 transfare learning)

this is a simple rest api serving a deep learning model that classifies human gender based on their faces. (vgg16 transfare learning)

crispengari 5 Dec 9, 2021
Inflated i3d network with inception backbone, weights transfered from tensorflow

I3D models transfered from Tensorflow to PyTorch This repo contains several scripts that allow to transfer the weights from the tensorflow implementat

Yana 479 Dec 8, 2022
Training Cifar-10 Classifier Using VGG16

opevcvdl-hw3 This project uses pytorch and Qt to achieve the requirements. Version Python 3.6 opencv-contrib-python 3.4.2.17 Matplotlib 3.1.1 pyqt5 5.

Kenny Cheng 3 Aug 17, 2022
VGG16 model-based classification project about brain tumor detection.

Brain-Tumor-Classification-with-MRI VGG16 model-based classification project about brain tumor detection. First, you can check what people are doing o

Atakan Erdoğan 2 Mar 21, 2022
Vit-ImageClassification - Pytorch ViT for Image classification on the CIFAR10 dataset

Vit-ImageClassification Introduction This project uses ViT to perform image clas

Kaicheng Yang 4 Jun 1, 2022
Reproduction process of AlexNet

PaddlePaddle论文复现杂谈 背景 注:该repo基于PaddlePaddle,对AlexNet进行复现。时间仓促,难免有所疏漏,如果问题或者想法,欢迎随时提issue一块交流。 飞桨论文复现赛地址:https://aistudio.baidu.com/aistudio/competitio

null 19 Nov 29, 2022