BestCryptoKnight / openai-emoji-prediction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python module error

im4media opened this issue · comments

Not sure if I have any incompatible modules locally(Ubuntu 20.4), the error seems can't be avoid after several trials.

$ python3 app.py
Traceback (most recent call last):
  File "/home/im2/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1110, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/im2/.local/lib/python3.10/site-packages/transformers/models/clip/modeling_clip.py", line 22, in <module>
    import torch.utils.checkpoint
  File "/home/im2/.local/lib/python3.10/site-packages/torch/utils/__init__.py", line 4, in <module>
    from .throughput_benchmark import ThroughputBenchmark
  File "/home/im2/.local/lib/python3.10/site-packages/torch/utils/throughput_benchmark.py", line 2, in <module>
    import torch._C
ModuleNotFoundError: No module named 'torch._C'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/im2/lab/mighty/challenges/openai-emoji-prediction/app.py", line 9, in <module>
    from transformers import CLIPProcessor, CLIPModel
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "/home/im2/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1101, in __getattr__
    value = getattr(module, name)
  File "/home/im2/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1100, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "/home/im2/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1112, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.models.clip.modeling_clip because of the following error (look up to see its traceback):
No module named 'torch._C'

As I mentioned in ReadMe.md, I have run python app.py on windows.
Might be an issue with different platforms.