kalekiu / easyesn

Python library for Reservoir Computing using Echo State Networks
129 stars 37 forks source link

AttributeError: module 'easyesn.backend' has no attribute 'ptp' #6

Closed tetsuyasu closed 4 years ago

tetsuyasu commented 5 years ago

Thank you for publishing very useful library. This works well on CPU. But, I got an error when using on GPU (cupy).

AttributeError: module 'easyesn.backend' has no attribute 'ptp'

I think that numpy has ptp but cupy does not have it.

denisj44 commented 4 years ago

I provided a pull request to fix it. Cheers

zimmerrol commented 4 years ago

Fixed by #13.

tetsuyasu commented 4 years ago

Thank you, "AttributeError: module 'easyesn.backend' has no attribute 'ptp'" is solved.

But, I run the PredictionExample, the following error occurred. I use cupy-cuda101==7.6.0.

Using Numpy backend. 100% (616 of 616) |#################################################################################| Elapsed Time: 0:00:00 Time: 0:00:00 100% (600 of 600) |#################################################################################| Elapsed Time: 0:00:00 Time: 0:00:00 (OK)

Using CuPy backend 100% (631 of 631) |#################################################################################| Elapsed Time: 0:00:00 Time: 0:00:00 100% (600 of 600) |#################################################################################| Elapsed Time: 0:00:00 Time: 0:00:00 Traceback (most recent call last): File "PredictionExample.py", line 42, in generation = esn.generate(n=len(inputDataValidation), inputData=None, initialOutputData=inputDataTraining[-1]) File "../src/easyesn/easyesn/PredictionESN.py", line 238, in generate _, Y = self.propagate(inputData, None, verbose=verbose, steps=n, previousOutputData=initialOutputData) File "../src/easyesn/easyesn/BaseESN.py", line 135, in propagate Y[t-transientTime, :] = previousOutputData File "cupy/core/core.pyx", line 1248, in cupy.core.core.ndarray.setitem File "cupy/core/_routines_indexing.pyx", line 49, in cupy.core._routines_indexing._ndarray_setitem File "cupy/core/_routines_indexing.pyx", line 811, in cupy.core._routines_indexing._scatter_op File "cupy/core/_kernel.pyx", line 930, in cupy.core._kernel.ufunc.call File "cupy/core/_kernel.pyx", line 404, in cupy.core._kernel._get_out_args ValueError: Out shape is mismatched (ERROR)

PredictionExample.zip