According to docs, there is a
scipy.signal.stft
but when trying to access that function I get the error from the title. The function is documented here.
Also, scip.signal.istft does not exist either. Any suggestions?
From the docs:
New in version 0.19.0.
http://scipy.github.io/devdocs/generated/scipy.signal.stft.html#scipy.signal.stft
You need to check your module version, you van refer to this post.
stft func is added in the SciPy 0.19.0, check this post to upgrade your module to the newsest version.
You need to upgrade to v 0.19.0. I tried many ways to do that but always got 0.18 instead. So to upgrade to 0.19.0 just simply do
pip install scipy==0.19.0
Related
I am trying to install TensorFlow in Python. I am getting the following error message, I tried uninstalling NumPy and re-installing NumPy but still getting the same error message. Can someone please help me to resolve this issue?
AttributeError: module 'numpy' has no attribute 'typeDict'
I was trying to use the package pyensembl and ran into this same issue. I was able to work around it for now with
pip install numpy==1.21
Which should suffice until some of these less active packages are able to update to the new API.
As we can see in NumPy 1.21.0 Release Notes
np.typeDict is a deprecated alias for np.sctypeDict and has been so
for over 14 years
(6689502).
A deprecation warning will now be issued whenever getting np.typeDict.
(gh-17586)
This means you are using a NumPy version that removed the deprecated ways AND the library you are using wasn't updated to match that version (uses something like np.typeDict instead of np.sctypeDict).
You have at least three options now
Report the issue and wait until it gets fixed by TensorFlow.
Use an older version of numpy (one before it started to issue the deprecation warning) and wait for it to be fixed.
Change np.typeDict to np.sctypeDict wherever is being used.
I'm trying to run this example, but getting the following error:
AttributeError: module 'skimage.filters' has no attribute 'gaussian_filter'
I checked the documentation, here, and see that filters has gaussian_filter. What might be wrong?
Thanks.
gaussian_filter has been removed in skimage 0.14.0 (see the release notes - http://scikit-image.org/docs/stable/api_changes.html). You should now use skimage.filters.gaussian (http://scikit-image.org/docs/0.14.x/api/skimage.filters.html#skimage.filters.gaussian).
I had a similar problem with the mahotas module, which was because of the version. Un-installed and re-installed an older version resolved the problem
When I run from flask.ext.mysql import MySQL I get the warning Importing flask.ext.mysql is deprecated, use flask_mysql instead.
So I installed flask_mysql using pip install flask_mysql,installed it successfully but then when I run from flask_mysql import MySQL I get the error No module named flask_mysql. In the first warning I also get Detected extension named flaskext.mysql, please rename it to flask_mysql. The old form is deprecated.
.format(x=modname), ExtDeprecationWarning. Could you please tell me how exactly should I rename it to flask_mysql?
Thanks in advance.
flask.ext. is a deprecated pattern which was used prevalently in older extensions and tutorials. The warning is telling you to replace it with the direct import, which it guesses to be flask_mysql. However, Flask-MySQL is using an even more outdated pattern, flaskext.. There is nothing you can do about that besides convincing the maintainer to release a new version that fixes it. from flaskext.mysql import MySQL should work and avoid the warning, although preferably the package would be updated to use flask_mysql instead.
flask.ext.X is the old form to import a Flask extension, it is deprecated since Flask v0.10. The new way is to use flask_X. That's why you got the first warning.
But apparently, Flask-MySQL does not update it's name form and use the flaskext as the package name (chedck it on GitHub). That's why you got the second warning.
Since i've installed the last version of matplotlib (1.5.1), I have the following error when i try to plot values with datetime as X.
DeprecationWarning: Using both 'count' and 'until' is inconsistent
with RFC 2445 and has been deprecated in dateutil. Future versions
will raise an error.
Does someone met ths error, and knows how to correct it ?
The issue have been fixed on matplotlib, but not released in a finalised version (>= 1.5.2)
I had to install the current working version with
pip install git+https://github.com/matplotlib/matplotlib
First of all it is not an error. It's a warning.
Second, most likely the problem is not your problem rather a problem in Matplotlib, which need to fix how they call a function or some method form python-dateutil. Most likely, you can ignore this warning, and it will be fixed in the next Matplotlib version.
Best solution :
in the file /matplotlib/dates.py, the line 830 :
self.rule.set(dtstart=start, until=stop, count=self.MAXTICKS + 1)
shall be commented
I am trying to follow the tutorial given in:
https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_video/py_bg_subtraction/py_bg_subtraction.html
While trying the third example (BackgroundSubtractorGMG) I get this error:
AttributeError: 'module' object has no attribute 'createBackgroundSubtractorGMG'
I got the same error for the earlier examples. But I followed the explanation given in this post. some how, the same trick did not work here.
If there is some one who has managed to solve it, please help me out.
Using Python 2.7.3 & opencv 2.4.6.1 on Ubuntu 12.04
In OpenCV 3.0.0-dev, you have to compile with the contrib repos and then it's in the bgsegm sub-module. I.e. just call cv2.bgsegm.createBackgroundSubtractorGMG()
cv2.bgsegm.createBackgroundSubtractorGMG()
cv2.createBackgroundSubtractorMOG2()
cv2.bgsegm.createBackgroundSubtractorMOG(),
**this worked for me **
oh dear, that's another one of those stories ...
with 2.4.6, you only can use BackgroundSubtractorMOG from python. (full stop)
as of 2.4.8, it seems, the BackgroundSubtractorMOG2 problem got fixed, but the BackgroundSubtractorGMG is still missing.
with both versions, you use a plain constructor to create one.
in 3.0 (master), they changed the syntax, you now have to call 'createBackgroundSubtractorGMG', 'createBackgroundSubtractorMOG2' and such (that's what your tutorial might be refering to). but now you can use all 3 versions at least.
so in any way, if you want to use BackgroundSubtractorMOG2 , you'll have to update to 2.4.8, if you need BackgroundSubtractorGMG, you'll need 3.0 (which is 'bleeding edge' in a way, but the new interface has the far better control over the params needed, imho).
bgsegm was in contrib module of opencv, but after the update I am not sure.
But still,
if you have not built contrib module:
pip install opencv-contrib-python
Make sure no console is running that has imported cv2 while you execute your installing process.
Run the cmd as Administration
It worked for me.