You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using pyfftw for the FFT backend. For scipy, if you have the full traceback of all your issues, I can take a look. Right now I'm not sure what the specific problems are.
from . import morlet
File "......\anaconda3\lib\site-packages\ghost\wave\morlet.py", line 5, in
from scipy.misc import logsumexp
ImportError: cannot import name 'logsumexp' from 'scipy.misc' (C:\Users\jerem\anaconda3\lib\site-packages\scipy\misc_init.py)_
I changed in the file scipy.misc by scipy.special
_from .fourier import clean_scipy_cache
File ".....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 5, in
import scipy.fftpack._fftpack as sff
ModuleNotFoundError: No module named 'scipy.fftpack.fftpack'
I changed by from scipy.fftpack import fft as sff
And I saw your last message that you use pyfftw so i installed this package and it works.
I think that pyfftw must be installed for a good work .
The issue with scipy is that they removed some functions in later versions. I'll get around to fixing that today so that you can still use scipy as the fft backend if you want. But in general I do prefer to use pyfftw.
I think the two pull requests I proposed will fix these issues. But you should update the home page example to also import pyfftw so that people do this by default.
File "....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 11, in clean_scipy_cache
sff.destroy_zfft_cache()
AttributeError: 'function' object has no attribute 'destroy_zfft_cache'
INFO:ghost:'timestamps' not passed in; generating from data
WARNING:root:Module 'pyfftw' not found, using scipy backend
Traceback (most recent call last):
File "", line 2, in
cwt.transform(data =Accz, fs =10000, voices_per_octaveint=48) #, ,freqs=frevoices_per_octaveint=48 timestamps =Time, freq_limits =[10,401] ,
File "......\anaconda3\lib\site-packages\ghost\formats\preprocessing.py", line 187, in wrap_function
return function(*args, **kwargs)
File "......\anaconda3\lib\site-packages\ghost\wave\transforms.py", line 224, in transform
wavelet_conv((ii, freq, length))
File ".......\anaconda3\lib\site-packages\ghost\wave\transforms.py", line 203, in wavelet_conv
res = convfun(input_asarray[..., start:stop], kernel)
File ".....\anaconda3\lib\site-packages\ghost\sigtools\convolution.py", line 81, in fastconv_scipy
clean_scipy_cache()
File ".....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 11, in clean_scipy_cache
sff.destroy_zfft_cache()
AttributeError: 'function' object has no attribute 'destroy_zfft_cache'
File ".....\anaconda3\lib\site-packages\ghost\sigtools\convolution.py", line 81, in fastconv_scipy
clean_scipy_cache()
File ".....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 11, in clean_scipy_cache
sff.destroy_zfft_cache()
AttributeError: 'function' object has no attribute 'destroy_zfft_cache'
Those two lines above no longer exist. You need to git pull to update to the latest code and then run pip install again.
Navigate to the directory you want to place the cloned repo in.
git clone https://github.com/nelpy/ghost.git
cd ghost
pip3 install .
and run your script, do you get the same error?
If you still have the error, try exporting your environment by running conda env export > environment.yml. Then upload that file here and I'll try to reproduce the error on my machine.
Great! It should work fine on either scipy or fftw now. Let me know if you run into any further issues. If there aren't any related ones in the next couple of days, I'll close this one out.
Activity
jchutrue commentedon Feb 2, 2021
Hello,
What version of scipy are you using, and do you have a full traceback of the issue when you run the code?
jeremyNG-lab commentedon Feb 2, 2021
I use scipy 1.3.0 but I had lot of problem with scipy like No module named....
What version you use?
jchutrue commentedon Feb 2, 2021
I've been using pyfftw for the FFT backend. For scipy, if you have the full traceback of all your issues, I can take a look. Right now I'm not sure what the specific problems are.
jeremyNG-lab commentedon Feb 2, 2021
So at the bigging I use the last scipy (1.6.0)
from . import morlet
File "......\anaconda3\lib\site-packages\ghost\wave\morlet.py", line 5, in
from scipy.misc import logsumexp
ImportError: cannot import name 'logsumexp' from 'scipy.misc' (C:\Users\jerem\anaconda3\lib\site-packages\scipy\misc_init.py)_
I changed in the file scipy.misc by scipy.special
_from .fourier import clean_scipy_cache
File ".....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 5, in
import scipy.fftpack._fftpack as sff
ModuleNotFoundError: No module named 'scipy.fftpack.fftpack'
I changed by from scipy.fftpack import fft as sff
And I saw your last message that you use pyfftw so i installed this package and it works.
I think that pyfftw must be installed for a good work .
jchutrue commentedon Feb 2, 2021
The issue with scipy is that they removed some functions in later versions. I'll get around to fixing that today so that you can still use scipy as the fft backend if you want. But in general I do prefer to use pyfftw.
ckemere commentedon Feb 2, 2021
I think the two pull requests I proposed will fix these issues. But you should update the home page example to also
import pyfftwso that people do this by default.Require scipy >1.0 and address #5, #6, #8
jchutrue commentedon Feb 2, 2021
@jeremyNG-lab The errors should be gone now--let us know how it looks on your system
jeremyNG-lab commentedon Feb 2, 2021
Without the FFT backend I have the same issu:
File "....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 11, in clean_scipy_cache
sff.destroy_zfft_cache()
AttributeError: 'function' object has no attribute 'destroy_zfft_cache'
ckemere commentedon Feb 2, 2021
The master branch has been changed. Make sure you pip install it again?
jeremyNG-lab commentedon Feb 3, 2021
I redownload and reinstall the package. But with scipy it didn't work, the same issue.
jchutrue commentedon Feb 3, 2021
This might have something to do with scipy's legacy code. Try it now?
EDIT: i.e. run
pip installagainjeremyNG-lab commentedon Feb 3, 2021
INFO:ghost:'timestamps' not passed in; generating from data
WARNING:root:Module 'pyfftw' not found, using scipy backend
Traceback (most recent call last):
File "", line 2, in
cwt.transform(data =Accz, fs =10000, voices_per_octaveint=48) #, ,freqs=frevoices_per_octaveint=48 timestamps =Time, freq_limits =[10,401] ,
File "......\anaconda3\lib\site-packages\ghost\formats\preprocessing.py", line 187, in wrap_function
return function(*args, **kwargs)
File "......\anaconda3\lib\site-packages\ghost\wave\transforms.py", line 224, in transform
wavelet_conv((ii, freq, length))
File ".......\anaconda3\lib\site-packages\ghost\wave\transforms.py", line 203, in wavelet_conv
res = convfun(input_asarray[..., start:stop], kernel)
File ".....\anaconda3\lib\site-packages\ghost\sigtools\convolution.py", line 81, in fastconv_scipy
clean_scipy_cache()
File ".....\anaconda3\lib\site-packages\ghost\sigtools\fourier.py", line 11, in clean_scipy_cache
sff.destroy_zfft_cache()
AttributeError: 'function' object has no attribute 'destroy_zfft_cache'
jchutrue commentedon Feb 3, 2021
Those two lines above no longer exist. You need to
git pullto update to the latest code and then runpip installagain.jeremyNG-lab commentedon Feb 3, 2021
(base) C:....>pip3 install git+https://github.com/nelpy/ghost.git
Collecting git+https://github.com/nelpy/ghost.git
Cloning https://github.com/nelpy/ghost.git to c:\users\jerem\appdata\local\temp\pip-req-build-syyxcccr
Requirement already satisfied: numpy>=1.15.0 in c:\users\jerem\anaconda3\lib\site-packages (from ghost==0.0.0) (1.19.2)
Requirement already satisfied: scipy>=1.0 in c:\users\jerem\anaconda3\lib\site-packages (from ghost==0.0.0) (1.6.0)
Requirement already satisfied: matplotlib>=3.0 in c:\users\jerem\anaconda3\lib\site-packages (from ghost==0.0.0) (3.3.4)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (1.3.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (2.4.7)
Requirement already satisfied: cycler>=0.10 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (0.10.0)
Requirement already satisfied: pillow>=6.2.0 in c:\users\jerem\anaconda3\lib\site-packages (from matplotlib>=3.0->ghost==0.0.0) (8.1.0)
Requirement already satisfied: six in c:\users\jerem\anaconda3\lib\site-packages (from cycler>=0.10->matplotlib>=3.0->ghost==0.0.0) (1.15.0)
I did it
I launched the script and I have the same error
jchutrue commentedon Feb 3, 2021
If you instead install like so:
pip3 uninstall ghostgit clone https://github.com/nelpy/ghost.gitcd ghostpip3 install .and run your script, do you get the same error?
If you still have the error, try exporting your environment by running
conda env export > environment.yml. Then upload that file here and I'll try to reproduce the error on my machine.jeremyNG-lab commentedon Feb 3, 2021
Yes it works.
Really Thanks
But with pyfftw it works everytime
jchutrue commentedon Feb 3, 2021
Great! It should work fine on either scipy or fftw now. Let me know if you run into any further issues. If there aren't any related ones in the next couple of days, I'll close this one out.