我试图在Jupyter笔记本的应用程序中执行此行。
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
我收到以下错误:
.conda/envs/py27/lib/python2.7/site-packages/tensorflow/contrib/__init__.py in <module>()
23
24 # Add projects here, they will show up under tf.contrib.
---> 25 from tensorflow.contrib import batching
26 from tensorflow.contrib import bayesflow
27 from tensorflow.contrib import cloud
ImportError: cannot import name batching
如果这样运行,不会收到此错误:
python -c "from tensorflow.examples.tutorials.mnist import input_data"
有人可以告诉我是什么引起了Jupyter Notebook中的错误
从jupyter notebook导入库时遇到了类似的问题,问题一直是我忘记jupyter
在新的conda环境中安装,但是jupyter是在根环境中安装的。
根据给出的错误,确保在condapy27
环境中安装了jupyter 。如果未安装,则默认在根环境中打开一个。
因此在终端中:
source activate py27 # activate py27 if on windows
conda install jupyter
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句