0

I am trying to use a script that uses torch but I keep getting this Attribute Error:

AttributeError: partially initialized module 'torch' has no attribute 'Tensor' (most likely due to a circular import)

I have tried running

pip3 uninstall torch
pip3 uninstall torchvision
pip3 uninstall torchaudio
pip3 install torch
pip3 install torchvision
pip3 install torchaudio

But this has not worked for me. Does anybody know how I can fix this? Any help would be greatly greatly appreciated!

Anna M
  • 21
  • 1
  • How are the imports in the file you are trying to execute? – Ivan Feb 28 '23 at 15:29
  • import detectron2.utils.comm as com import detectron2.data.transforms as T from detectron2.checkpoint import DetectionCheckpointer from detectron2.config import get_cfg from detectron2.data import DatasetMapper, build_detection_train_loader from detectron2.data.datasets import register_coco_instances from detectron2.engine import ( DefaultTrainer, default_argument_parser, default_setup, hooks, launch, ) from detectron2.evaluation import ( COCOEvaluator, verify_results, ) from detectron2.modeling import GeneralizedRCNNWithTTA import pandas as pd – Anna M Mar 01 '23 at 17:09
  • @Ivan above are the imports I included in my file – Anna M Mar 01 '23 at 17:11

0 Answers0