اذهب إلى المحتوى

السؤال

نشر

أثناء محاولة استخدام Sequential في Keras يظهر لي الخطأ التالي:

from keras.datasets import imdb
from keras.preprocessing import sequence
from keras import layers
from keras.models import Sequential
max_features = 10000
maxlen = 500
(x_train, y_train), (x_test, y_test) = imdb.load_data(
num_words=max_features)
x_train = [x[::-1] for x in x_train]
x_test = [x[::-1] for x in x_test]
x_train = sequence.pad_sequences(x_train, maxlen=maxlen)
x_test = sequence.pad_sequences(x_test, maxlen=maxlen)
model = Sequential()
model.add(layers.Embedding(max_features, 100))
model.add(layers.Bidirectional(layers.LSTM(64)))
model.add(layers.Dense(1, activation='sigmoid'))
model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc'])
history = model.fit(x_train, y_train,
epochs=8,
batch_size=64,
validation_split=0.2)
--------------------------------------------------------------------------------------------------------------------
  File "/anaconda/lib/python2.7/site-packages/keras/__init__.py", line 4, in <module>
    from . import applications
  File "/anaconda/lib/python2.7/site-packages/keras/applications/__init__.py", line 1, in <module>
    from .vgg16 import VGG16
  File "/anaconda/lib/python2.7/site-packages/keras/applications/vgg16.py", line 14, in <module>
    from ..models import Model
  File "/anaconda/lib/python2.7/site-packages/keras/models.py", line 14, in <module>
    from . import layers as layer_module
  File "/anaconda/lib/python2.7/site-packages/keras/layers/__init__.py", line 4, in <module>
    from ..engine import Layer
  File "/anaconda/lib/python2.7/site-packages/keras/engine/__init__.py", line 8, in <module>
    from .training import Model
  File "/anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 24, in <module>
    from .. import callbacks as cbks
  File "/anaconda/lib/python2.7/site-packages/keras/callbacks.py", line 25, in <module>
    from tensorflow.contrib.tensorboard.plugins import projector
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/__init__.py", line 30, in <module>
    from tensorflow.contrib import factorization
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/factorization/__init__.py", line 24, in <module>
    from tensorflow.contrib.factorization.python.ops.gmm import *
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/factorization/python/ops/gmm.py", line 27, in <module>
    from tensorflow.contrib.learn.python.learn.estimators import estimator
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/__init__.py", line 87, in <module>
    from tensorflow.contrib.learn.python.learn import *
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/__init__.py", line 23, in <module>
    from tensorflow.contrib.learn.python.learn import *
    File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/__init__.py", line 25, in <module>
    from tensorflow.contrib.learn.python.learn import estimators
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py", line 297, in <module>
    from tensorflow.contrib.learn.python.learn.estimators.dnn import DNNClassifier
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py", line 29, in <module>
    from tensorflow.contrib.learn.python.learn.estimators import dnn_linear_combined
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py", line 31, in <module>
    from tensorflow.contrib.learn.python.learn.estimators import estimator
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 49, in <module>
    from tensorflow.contrib.learn.python.learn.learn_io import data_feeder
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_io/__init__.py", line 21, in <module>
    from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data
  File "/anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py", line 26, in <module>
    import dask.dataframe as dd
  File "/anaconda/lib/python2.7/site-packages/dask/dataframe/__init__.py", line 3, in <module>
    from .core import (DataFrame, Series, Index, _Frame, map_partitions,
  File "/anaconda/lib/python2.7/site-packages/dask/dataframe/core.py", line 38, in <module>
    pd.computation.expressions.set_use_numexpr(False)
AttributeError: 'module' object has no attribute 'computation'

 

Recommended Posts

  • 1
نشر (معدل)

السبب لهذا الخطأ هو أخطاء  في إصدار pandas الذي لديك. تم إطلاق نسخة أحدث من dask  للتعامل مع هذا الخطأ قم بتحديث dask. في حال كنت تستخدم بيئة أناكوندا:

conda update dask

أو:

pip install --upgrade dask

أو قم بتحديث pandas إلى الإصدار الجديد:

conda update pandas
# أو
pip install --upgrade pandas

 

تم التعديل في بواسطة Ali Haidar Ahmad

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...