torch._C._onnx AttributeError

Traceback (most recent call last):
File “torch2onnx.py”, line 8, in <module>
import torch.onnx
File “/media/hls/f2906de6-c260-4b56-89d8-7718e594b683/anaconda3/lib/python3.6/site-packages/torch/onnx/init.py”, line 6, in <module>
TensorProtoDataType = _C._onnx.TensorProtoDataType
AttributeError: module ‘torch._C’ has no attribute ‘_onnx’