Running the tutorial at https://pytorch.org/tutorials/advanced/static_quantization_tutorial.html 6 raises exception

/usr/local/lib/python3.6/dist-packages/torch/quantization/observer.py in calculate_qparams(self)
44         n_levels = 255.0
45         if self.max_val is None or self.min_val is None:
—> 46             raise Exception(‘must run observer before calling calculate_qparams!’)
47         max_val, min_val = self.max_val.item(), self.min_val.item()
48         if max_val == min_val:
Exception: must run observer before calling calculate_qparams!