Skip to content

Error in Quick start #2

@mmcheraghi

Description

@mmcheraghi

Hi
Firstly, I appreciate you for this project. It seems you haven't updated your code since four years ago. Some errors occur for

python3 main_binary.py -a mobilenet --mobilenet_width 1.0 --mobilenet_input 224 --save Imagenet/mobilenet_224_1.0_w8a8 --dataset imagenet --type_quant 'PerLayerAsymPACT' --weight_bits 8 --activ_bits 8 --activ_type learned --gpus 0,1,2,3 -j 8 --epochs 12 -b 128 --save_check --quantizer --batch_fold_delay 1 --batch_fold_type folding_weights

I solved some of them by using

  • transforms.Resize instead of transforms.Scale
  • reader = tf.train.load_checkpoint(tensorflow_model) instead of reader = pywrap_tensorflow.NewCheckpointReader(tensorflow_model)
  • correct_k = correct[:k].reshape(-1).float().sum(0) instead of correct_k = correct[:k].view(-1).float().sum(0)

I got stucked at this error:

Traceback (most recent call last):
  File "/content/training-mixed-precision-quantized-networks/main_binary.py", line 456, in <module>
    main()
  File "/content/training-mixed-precision-quantized-networks/main_binary.py", line 286, in main
    train_loss, train_prec1, train_prec5 = train(
  File "/content/training-mixed-precision-quantized-networks/main_binary.py", line 443, in train
    return forward(data_loader, model, criterion, epoch,
  File "/content/training-mixed-precision-quantized-networks/main_binary.py", line 411, in forward
    quantizer.backprop_quant_gradients()    
  File "/content/training-mixed-precision-quantized-networks/quantization/quantop.py", line 1037, in backprop_quant_gradients
    w_max_param.grad.data = grad_a_max
AttributeError: 'NoneType' object has no attribute 'data'

Can you take a look at it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions