Repository: mlcommons/inference
Issue: Pytorch Reference Resnet50 Int8 run
Root cause: Validation Gap

Hi, 
Is there a path enabled for int8 model for pytorch resnet50 int8?

I replaced the model in run_common https://github.com/mlcommons/inference/blob/48ed1c9f31456f024be7599876873b7c5429b7df/vision/classification_and_detection/run_common.sh#L85 with int8 model with the int8 model and get the below -

`ubuntu@ip-172-31-21-80:~/sgattupa/mlperf_inference/vision/classification_and_detection$ ./run_local.sh pytorch resnet50 cpu
--dataset-path /home/ubuntu/sgattupa/datasets/dataset-imagenet-ilsvrc2012-val
In main
INFO:main:Namespace(accuracy=False, backend='pytorch', cache=0, count=None, data_format=None, dataset='imagenet', dataset_list=None, dataset_path='/home/ubuntu/sgattupa/datasets/dataset-imagenet-ilsvrc2012-val', debug=False, find_peak_performance=False, inputs=None, max_batchsize=32, max_latency=None, mlperf_conf='../../mlperf.conf', model='/home/ubuntu/sgattupa/mlperf_inference/vision/classification_and_detection/models//resnet50_INT8bit_quantized.pt', model_name='resnet50', output='/home/ubuntu/sgattupa/mlperf_inference/vision/classification_and_detection/output/pytorch-cpu/resnet50', outputs=['ArgMax:0'], profile='resnet50-onnxruntime', qps=None, samples_per_query=None, scenario='SingleStream', threads=16, time=None, user_conf='user.conf')
INFO:root:Failed to import cuda module: No module named 'caffe2.python.caffe2_pybind11_state_gpu'
INFO:root:Failed to import AMD hip module: No module named 'caffe2.python.caffe2_pybind11_state_hip'
WARNING:root:This caffe2 python run failed to load cuda module:No module named 'caffe2.python.caffe2_pybind11_state_gpu',and AMD hip module:No module named 'caffe2.python.caffe2_pybind11_state_hip'.Will run in CPU only mode.
INFO:imagenet:reduced image list, 48976 images not found
INFO:imagenet:loaded 1024 images, cache=0, took=0.3sec
Traceback (most recent call last):
  File "python/main.py", line 558, in <module>
    main()
  File "python/main.py", line 436, in main
    model = backend.load(args.model, inputs=args.inputs, outputs=args.outputs)
  File "/home/ubuntu/sgattupa/mlperf_inference/vision/classification_and_detection/python/backend_pytorch.py", line 34, in load
    self.model = onnx.load(model_path)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/onnx/__init__.py", line 119, in load_model
    model = load_model_from_string(s, format=format)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/onnx/__init__.py", line 156, in load_model_from_string
    return _deserialize(s, ModelProto())
  File "/home/ubuntu/.local/lib/python3.7/site-packages/onnx/__init__.py", line 97, in _deserialize
    decoded = cast(Optional[int], proto.ParseFromString(s))
  File "/home/ubuntu/.local/lib/python3.7/site-packages/google/protobuf/message.py", line 199, in ParseFromString
    return self.MergeFromString(serialized)
  File "/home/ubuntu/.local/lib/python3.7/site-packages/google/protobuf/internal/python_message.py", line 1145, in MergeFromString
    if self._InternalParse(serialized, 0, length) != length:
  File "/home/ubuntu/.local/lib/python3.7/site-packages/google/protobuf/internal/python_message.py", line 1195, in InternalParse
    raise message_mod.DecodeError('Field number 0 is illegal.')
google.protobuf.message.DecodeError: Field number 0 is illegal.`

Is there a way to run the int8 model with reference code?

Running into the same issue with the `ResNet50-int8` quantized PyTorch model as well - any updates or insights as to how to fix this would be much appreciated. Thank you!