Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detectron2/utils/tracing.py", line 5, in <module> from torch.fx._symbolic_trace import is_fx_tracing as is_fx_tracing_current ImportError: cannot import name 'is_fx_tracing' from 'torch.fx._symbolic_trace' #4489

Open
lucasjinreal opened this issue Aug 18, 2022 · 12 comments

Comments

@lucasjinreal
Copy link

detectron2/utils/tracing.py", line 5, in
from torch.fx._symbolic_trace import is_fx_tracing as is_fx_tracing_current
ImportError: cannot import name 'is_fx_tracing' from 'torch.fx._symbolic_trace'

Please fix it, this error exits long time....

@github-actions
Copy link

You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template.
The following information is missing: "Instructions To Reproduce the Issue and Full Logs"; "Your Environment";

@github-actions github-actions bot added the needs-more-info More info is needed to complete the issue label Aug 18, 2022
@lucasjinreal
Copy link
Author

image

this this anoying logging still exist????

I get it , I don't want this logging anymore...... I know the weights is correct, Please remove this reduandant code.

@github-actions github-actions bot removed the needs-more-info More info is needed to complete the issue label Aug 18, 2022
@snapcart-ruben
Copy link

torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

ModuleNotFoundError: No module named 'torch.fx._symbolic_trace' on deployment

@YueBro
Copy link

YueBro commented Aug 18, 2022

Solution: use the previous commit...

git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
git checkout 5aeb252b194b93dc2879b4ac34bc51a31b5aee13
cd ..
python -m pip install -e detectron2

@Hemanthkumar2112
Copy link

Hemanthkumar2112 commented Aug 19, 2022

@jinfagang jinfagang i also faced this same issue
ImportError: cannot import name 'is_fx_tracing' from 'torch.fx._symbolic_trace' looks like its a flag from torch model
https://github.com/pytorch/pytorch/blob/master/torch/fx/_symbolic_trace.py#L44

so i have changed manually in detectron2/utils/tracing.py command the import and add following code
image (6)

_is_fx_tracing_flag = False
def is_fx_tracing_current():return _is_fx_tracing_flag

@patchy631
Copy link

@jinfagang jinfagang i also faced this same issue ImportError: cannot import name 'is_fx_tracing' from 'torch.fx._symbolic_trace' looks like its a flag from torch model https://github.com/pytorch/pytorch/blob/master/torch/fx/_symbolic_trace.py#L44

so i have changed manually in detectron2/utils/tracing.py command the import and add following code image (6)

_is_fx_tracing_flag = False def is_fx_tracing_current():return _is_fx_tracing_flag

did it work for you?

@Hemanthkumar2112
Copy link

Hemanthkumar2112 commented Aug 19, 2022

Yes , it worked

@patrickvonplaten
Copy link

patrickvonplaten commented Aug 19, 2022

This is also affected other libraries such as Transformers - see: huggingface/transformers@1f3c228

Could we fix this on master?

@Hemanthkumar2112
Copy link

This is also affected other libraries such as Transformers - see: huggingface/transformers@1f3c228

Could we fix this on master?

this could temp fix

@yan-ctrl
Copy link

Solution: use the previous commit...

git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
git checkout 5aeb252b194b93dc2879b4ac34bc51a31b5aee13
cd ..
python -m pip install -e detectron2

Thanks

@srikanth-midde
Copy link

Yes , it worked

I tried this but not worked. Can you check it once again

@simonhollis
Copy link

This should now be fixed with the merge of #4491 and facebookresearch/d2go#362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants