When using the above example and converting my model, I get this error:
Traceback (most recent call last):
File “detection/main_mp.py”, line 734, in 
main()
File “detection/main_mp.py”, line 592, in main
p = torch.quantization.convert(myModel)
File “/home/megan/.local/lib/python2.7/site-packages/torch/quantization/quantize.py”, line 293, in convert
convert(mod, mapping, inplace=True)
File “/home/megan/.local/lib/python2.7/site-packages/torch/quantization/quantize.py”, line 294, in convert
reassign[name] = swap_module(mod, mapping)
File “/home/megan/.local/lib/python2.7/site-packages/torch/quantization/quantize.py”, line 316, in swap_module
new_mod = mapping[type(mod)].from_float(mod)
File “/home/megan/.local/lib/python2.7/site-packages/torch/nn/quantized/modules/conv.py”, line 243, in from_float
qweight = _quantize_weight(mod.weight.float(), weight_observer)
File “/home/megan/.local/lib/python2.7/site-packages/torch/nn/quantized/modules/utils.py”, line 12, in _quantize_weight
wt_scale.to(torch.double), wt_zp.to(torch.int64), 0, torch.qint8)
RuntimeError: No function is registered for schema aten::quantize_per_channel(Tensor self, Tensor scales, Tensor zero_points, int axis, ScalarType dtype) -> Tensor on tensor type CUDATensorId; available functions are CPUTensorId, VariableTensorId
I have moved my model to cpu and confirmed it is not running on CUDA.