question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name 'is_fx_tracing' from 'torch.fx._symbolic_trace'

See original GitHub issue

Error 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:open
  • Created a year ago
  • Reactions:6
  • Comments:17

github_iconTop GitHub Comments

6reactions
BastianBoppcommented, Aug 18, 2022

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

3reactions
leoliu37commented, Aug 18, 2022

This is the problem of detecron2 version, I solve it by installing suitable version in https://github.com/facebookresearch/detectron2/releases

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - ImportError about Detectron2 - Stack Overflow
Does anyone know how to fix it? ImportError: cannot import name 'is_fx_tracing' from 'torch.fx._symbolic_trace' (/home/eric/anaconda3/envs/ ...
Read more >
torch.fx — PyTorch 1.13 documentation
Module instance that holds a Graph as well as a forward method generated from the Graph. Taken together, this pipeline of components (symbolic...
Read more >
Source code for torch_geometric.nn.fx - PyTorch Geometric
import copy from typing import Any, Dict, Optional import torch from torch.nn ... try: from torch.fx import Graph, GraphModule, Node except (ImportError, ...
Read more >
EASY PYTHON CODE TRANSFORMATION WITH TORCH.FX
torch. fx is a toolkit that allows you to perform source-to-source transformations of PyTorch nn. Module instances. It also gives you the ...
Read more >
[PyTorch][QNN] Cannot import TorchScript produced by FX ...
Hi, I tried to use the torch.fx based method to run static post-training quantization on a ResNet-18 model, then use torch.jit.trace to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found