I am getting following error when i am trying to run the imports
from datasets import load_dataset
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, GenerationConfig, TrainingArguments, Trainer
import torch
import time
import evaluate
import pandas as pd
import numpy as np
This is the stack trace of the error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in _get_module(self, module_name)
1125 try:
-> 1126 return importlib.import_module("." + module_name, self.__name__)
1127 except Exception as e:
/opt/conda/lib/python3.7/importlib/__init__.py in import_module(name, package)
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
128
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _gcd_import(name, package, level)
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _find_and_load(name, import_)
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _load_unlocked(spec)
/opt/conda/lib/python3.7/importlib/_bootstrap_external.py in exec_module(self, module)
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)
/opt/conda/lib/python3.7/site-packages/transformers/training_args.py in <module>
28
---> 29 from .debug_utils import DebugOption
30 from .trainer_utils import (
/opt/conda/lib/python3.7/site-packages/transformers/debug_utils.py in <module>
20 if is_torch_available():
---> 21 import torch
22
/opt/conda/lib/python3.7/site-packages/torch/__init__.py in <module>
217 _load_global_deps()
--> 218 from torch._C import * # noqa: F403
219
ImportError: /opt/conda/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so: cannot read file data
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
<ipython-input-4-31647e9def8f> in <module>
1 from datasets import load_dataset
----> 2 from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, GenerationConfig, TrainingArguments, Trainer
3 import torch
4 import time
5 import evaluate
/opt/conda/lib/python3.7/importlib/_bootstrap.py in _handle_fromlist(module, fromlist, import_, recursive)
/opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in __getattr__(self, name)
1114 value = self._get_module(name)
1115 elif name in self._class_to_module.keys():
-> 1116 module = self._get_module(self._class_to_module[name])
1117 value = getattr(module, name)
1118 else:
/opt/conda/lib/python3.7/site-packages/transformers/utils/import_utils.py in _get_module(self, module_name)
1129 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its"
1130 f" traceback):\n{e}"
-> 1131 ) from e
1132
1133 def __reduce__(self):
RuntimeError: Failed to import transformers.training_args because of the following error (look up to see its traceback):
/opt/conda/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so: cannot read file data