在conda env中使用jupyter notebook会导致在导入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)我的环境是在安装pandas、tensorflow-hub、numpy、tensorflow和python=3.8.5的基础上创建的。
有关更多详细信息,请参阅:
tensorflow 2.3.0
tensorflow-base 2.3.0
tensorflow-estimator 2.3.0 conda-forge
tensorflow-hub 0.12.0 conda-forge为什么我会得到这个错误?
发布于 2021-10-07 06:27:57
与Tensorflow 2.6.0配合使用,只需将接口名称更改为tf.compat.v1.estimator.experimental.dnn_logit_fn_builder即可
import tensorflow as tf
tf.compat.v1.estimator.experimental.dnn_logit_fn_builderhttps://stackoverflow.com/questions/69339917
复制相似问题