pytorch / android-demo-app

PyTorch android examples of usage in applications
1.46k stars 604 forks source link

ModuleNotFoundError: No module named 'torch.ao.quantization.quantize_fx' and segmentation fault when importing d2go #212

Open bennosski opened 2 years ago

bennosski commented 2 years ago

Followed the instructions in the README and get: ModuleNotFoundError: No module named 'torch.ao.quantization.quantize_fx'

To fix this, I tried installing the nightly version of pytorch but then got a seg fault when trying to run create_d2go.py which was caused by any of the d2go imports

cloveropen commented 2 years ago

open /usr/local/lib/python3.7/dist-packages/d2go/modeling/meta_arch/rcnn.py modify line 28 from torch.ao.quantization.quantize_fx import prepare_fx, prepare_qat_fx, convert_fx to from torch.quantization.quantize_fx import prepare_fx, prepare_qat_fx, convert_fx

modify line 243 else torch.ao.quantization.get_default_qconfig(cfg.QUANTIZATION.BACKEND) to else torch.quantization.get_default_qconfig(cfg.QUANTIZATION.BACKEND)