elephas: Elephas slice_X error

Elephas encounter this error with the latest theano. Can you help me fix this.

Traceback (most recent call last):
  File "/home/zeus/workspace/./KerasOnSparkElephas.py", line 28, in <module>
    from elephas.spark_model import SparkModel
  File "/home/zeus/anaconda2/lib/python2.7/site-packages/elephas/spark_model.py", line 18, in <module>
    from keras.models import model_from_yaml, slice_X
ImportError: cannot import name slice_X

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 24 (10 by maintainers)

Most upvoted comments

I tried running elephas by installing it thorugh pip and still got this error. Can’t this issue be opened again until a realase where this bug is fixed is deployed to Pypi?

As discussed in #22 , master branch now supports keras 1.x . To install this part of (un-released) updates, re-install elephas by

pip install --upgrade --no-deps git+git://github.com/maxpumperla/elephas

@mm1mm you need to update keras. this is a little annoying, but keras has first renamed slice_X to slice_arrays, but then also moved it several times without backward compatibility. Check out requirements for recommended versions.

I closed it because it has been addressed a while ago. It’s on master, just not on pypi

Does Elephas support Keras 2? I am getting this error on 2.1.

I solved by installing it with pip3 install git+https://github.com/maxpumperla/elephas

@maxpumperla I am getting the error ImportError: cannot import name slice_X with the elephas version 0.3 and keras 1.1.1. But the issue is solved when I installed master branch. I could see the change in the path of import statement in elephas master branch but not in 0.3 which is version we get via pip install

@haoyangz thanks for helping out here. Bit busy at the moment, but I’m preparing a new release to finally remedy this.

See #22, I still have to migrate to Keras 1.0. Please work with Keras 0.3 for now if you want to use elephas. Thanks!