Convert_graph_to_onnx.py "ImportError: attempted relative import with no known parent package"

Hi,

I’m trying to run this script but keep on getting failure because of

Traceback (most recent call last):
File “convert_graph_to_onnx.py”, line 22, in
from .file_utils import ModelOutput, is_tf_available, is_torch_available
ImportError: attempted relative import with no known parent package

Running python convert_graph_to_onnx.py --pipeline ner --model "KB/bert-base-swedish-cased-ner" --framework pt --tokenizer "KB/bert-base-swedish-cased-ner" --quantize kb-bert-cased-ner.onnx


:white_check_mark: Tried installing transformers from source
:white_check_mark: Tried running from root, src & src/transformers

Still not working

Yes, it’s a bug indded. This PR should fix it.

1 Like

Thanks for the response! :pray:

EDIT
NVM, had to reinstall