Search code examples
pythonpytorchtorchonnxtorchvision

module 'torch.onnx.symbolic_helper' has no attribute 'quantized_args'


while importing transforms from torchvision I am getting the following error

module 'torch.onnx.symbolic_helper' has no attribute 'quantized_args'

import that I performed

from torchvision import transforms

prior to the error it throws following warnings:

 OnnxExporterWarning: Symbolic function 'aten::_shape_as_tensor' already registered for opset 9. Replacing the existing function with new function. This is unexpected. Please report it on https://github.com/pytorch/pytorch/issues.
      errors.OnnxExporterWarning,

versions for torch and torchvsion

torch==1.13.0
torchvision==0.14.0

Additional Info: I have cuda enabled gpu using cuda 11.8.


Solution

  • In my case this was the version conflict error, try changing torch to only cpu version that should work and if you want to stick to gpu try using cuda==11.6 along with torch==1.13.0 and torchvision==0.14.0.

    conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
    

    Try referring to this link.

    https://pytorch.org/get-started/locally/