>>> import scipy as sp
>>> x1 = np.random.randint(low = 0, high = 255, size = [28, 28]) #创建随机图像
>>> sp.misc.imsave('your_path\x1.jpg', x1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'scipy' has no attribute 'misc'
解决方法如下:
添加:
>>> import scipy.misc
就不会再报这个错啦~