Issue
Using jupyter notebook
in a conda env
leads me to that error when importing tensorflow_hub
:
ImportError: cannot import name 'dnn_logit_fn_builder' from partially initialized module
'tensorflow_estimator.python.estimator.canned.dnn' (most likely due to a circular import)
(C:\Users\Anaconda3\envs\my_env\lib\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py)
My env was created installing pandas, tensorflow-hub, numpy, tensorflow and python=3.8.5.
For more details:
tensorflow 2.3.0
tensorflow-base 2.3.0
tensorflow-estimator 2.3.0 conda-forge
tensorflow-hub 0.12.0 conda-forge
Why am I getting this error?
Solution
In my case (Windows 10, Python 3.8, its own shell) I also encountered this problem. Then, individually importing the problematic line resolved issue. In other words, I wrote
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
then i imported
import tensorflow_hub as hub
everything was fine.
Answered By - Güray Hatipoğlu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.