python – Theano AttributeError:’module’对象没有属性’tests’
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了python – Theano AttributeError:’module’对象没有属性’tests’,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1759字,纯文字阅读大概需要3分钟。
内容图文
![python – Theano AttributeError:’module’对象没有属性’tests’](/upload/InfoBanner/zyjiaocheng/767/7b24e6b10d9a441db7eaf9dc104b4a51.jpg)
我有Keras安装了Theano后端,它工作正常,突然我导入keras时出现以下错误:
Using Theano backend.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-570b835f182b> in <module>()
1 # import keras
----> 2 from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
3 from keras.models import Sequential
4 from keras.layers import Convolution2D, MaxPooling2D
5 from keras.layers import Activation, Dropout, Flatten, Dense
/home/pjwstk.edu.pl/s16352/python/keras/keras/__init__.py in <module>()
1 from __future__ import absolute_import
----> 2 from . import backend
3 from . import datasets
4 from . import engine
5 from . import layers
/home/pjwstk.edu.pl/s16352/python/keras/keras/backend/__init__.py in <module>()
62 if _BACKEND == 'theano':
63 sys.stderr.write('Using Theano backend.\n')
---> 64 from .theano_backend import *
65 elif _BACKEND == 'tensorflow':
66 sys.stderr.write('Using TensorFlow backend.\n')
/home/pjwstk.edu.pl/s16352/python/keras/keras/backend/theano_backend.py in <module>()
----> 1 import theano
2 from theano import tensor as T
3 from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
4 from theano.tensor.signal import pool
5 from theano.tensor.nnet import conv3d2d
/home/pjwstk.edu.pl/s16352/python/Theano/theano/__init__.pyc in <module>()
98 # needed during that phase.
99 import theano.tests
--> 100 if hasattr(theano.tests, "TheanoNoseTester"):
101 test = theano.tests.TheanoNoseTester().test
102 else:
AttributeError: 'module' object has no attribute 'tests'
我在服务器上的Jupyter笔记本中运行它.
有线索吗?
解决方法:
您需要安装较旧版本的Theano:0.8.2.试试pip install Theano == 0.8.2.
内容总结
以上是互联网集市为您收集整理的python – Theano AttributeError:’module’对象没有属性’tests’全部内容,希望文章能够帮你解决python – Theano AttributeError:’module’对象没有属性’tests’所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。