小编Nat*_*Nat的帖子

ModuleNotFoundError:没有名为“自动重载”的模块

我使用python 3内核在jupyter笔记本上运行了卷积神经网络教程中的以下代码,并得到了ModuleNotFoundError:没有名为“ autoreload”的模块;

import numpy as np
import h5py          
import matplotlib.pyplot as plt

%matplotlib inline
plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of plots
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'

%load_ext autoreload   
%autoreload 2          
np.random.seed(1)

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-3d0ea63c7843> in <module>()
      8 plt.rcParams['image.cmap'] = 'gray'
      9 
---> 10 get_ipython().magic('load_ext autoreload   # reload modules before executing user code')
     11 get_ipython().magic('autoreload 2          # Reload all modules (except those excluded by %aimport)')
     12 

/opt/conda/lib/python3.6/site-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
   2156 …
Run Code Online (Sandbox Code Playgroud)

python-3.x jupyter

5
推荐指数
2
解决办法
1937
查看次数

标签 统计

jupyter ×1

python-3.x ×1