ImportError: cannot import name 'is_fx_tracing' from 'torch.fx._symbolic_trace'
See original GitHub issueError while running the Official Detectron2 Demo:
yesterday I ran it and it was working fine. Today, it is giving me error. Run code cell # 3 from the top. Where importing libraries. It gives error after the comment
# import some common detectron2 utilities
Link to the Cell:
https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5#scrollTo=ZyAvNCJMmvFF
It gives error on running the following line
from detectron2 import model_zoo
but if you comment above line, it gives same error on next line i.e.,
from detectron2.engine import DefaultPredictor
Error is
ImportError: cannot import name 'is_fx_tracing' from 'torch.fx._symbolic_trace' (/usr/local/lib/python3.7/dist-packages/torch/fx/_symbolic_trace.py)
it is easily reproduceable as it is given by default notebook. Opened a fresh one from the link given on following page https://github.com/facebookresearch/detectron2 Still the same error. Someone maybe pushed something in last 24 hours that made it give this error.
Issue Analytics
- State:
- Created a year ago
- Reactions:6
- Comments:17

Top Related StackOverflow Question
It seems like this issue was introduced with the latest commit (36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0).
Specifying the previous commit hash from august 4th to install detectron2 fixed this issue for me. pip install git+https://github.com/facebookresearch/detectron2.git@5aeb252b194b93dc2879b4ac34bc51a31b5aee13
This is the problem of detecron2 version, I solve it by installing suitable version in https://github.com/facebookresearch/detectron2/releases