music21 --> simplifyMultipleEnharmonics not available? - python

I'm trying to use the function pitch.simplifyMultipleEnharmonics(...): http://web.mit.edu/music21/doc/moduleReference/modulePitch.html#functions
but at line:
print music21.pitch.simplifyEnharmonics([pitch.Pitch('G3'),
pitch.Pitch('C-4'),
pitch.Pitch('D4')])
I get the error:
>>> 'module' object has no attribute 'simplifyMultipleEnharmonics'
... I'm using the latest version of music21 (just pip installed again).
... Is this function available only in an older version of music21?
Thanks very much for any help!

It's a new function for v3 which is the GitHub master branch so it's not in any of the releases yet. Sorry. Versioned docs are on the priority list to prevent problems like this.

Related

No attribute "target" in ChEMBL Database

I'm new for programming so I need help. As you in picture, although I installed chembl_webresource_client (pip3 install chembl_webresource_client), I couldn't work "target" module. Please help me!
By the way, My python version is Python 3.10.2enter image description here
This error shows you that there is no method called target in new_client and only a method called client_from_url inside new_client.py, and you may mean the same thing and want to use it.
And I suggest you share your chembl_webresource_client version.
that is last release of chembl_webresource_client == 0.10.7

module 'scipy.signal' has no attribute 'stft'

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

pack individual .jpg image files into RecordIO (.rec) files

I'm trying to go through the MXNET tutorial (https://statist-bhfz.github.io/cats_dogs_finetune), but have trouble making the RecordIO ".rec" files used to process the pictures.
I have tried the suggested approach:
python C:/mxnet-20170203/tools/im2rec.py --list=1 --recursive=1 --train-ratio=0.8 cats_dogs train_pad_224x224
python C:/mxnet-20170203/tools/im2rec.py --num-thread=4 --pass-through=1 cats_dogs_train.lst train_pad_224x224
python C:/mxnet-20170203/tools/im2rec.py --num-thread=4 --pass-through=1 cats_dogs_val.lst train_pad_224x224
But i get the error: "AttributeError: 'module' object has no attribute 'MXIndexedRecordIO'"
when doing so.
Is there a way to generate the ".rec" files in R directly? And if not, how do i get pass the error?
Thanks.
Kr,
Daniel
The error you are getting seems related to the fact that you are trying to use a newer version of im2rec.py than the one that came with your installed version of mxnet, hence the missing modules.
try using the im2rec.py script located in your own mxnet installation folder, somewhere like this python2.7/site-packages/mxnet/tools/im2rec.py
Also note that if you upgrade your version of mxnet, the syntax of im2rec has changed to:
im2rec.py --list --recursive --train-ratio=0.8 cats_dogs train_pad_224x224

python-opencv AttributeError: 'module' object has no attribute 'createBackgroundSubtractorGMG'

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.

Difficulty installing and using Mercurial Chart extension

Hi I'm having trouble installing and using the Mercurial ChartExtension
When I installed it as per instructions
First you need to install the extension; type this in your shell:
python ./setup.py install
Blockquote
I then modified my mercurial.ini file as follows
[extensions]
chart=/path/to/chart.py
Blockquote
Then tried running Hg Chart command and got the following error
Can anyone help me get this extension working. I know there's the Hg ActivityExtension as well, but i have not had much luck with that either Problem installing Mercurial Activity extension
A layman's guide to what steps i need to follow would be of immense help
Based on the changelog, the Chart extension has not been updated since late 2008. It would probably work if you tried using it with a version of Mercurial released around that same time (Mercurial v1.1.2 was released on Dec. 30, 2008).
The latest version of Mercurial is now v1.9.2. The API has changed (probably quite a bit) since v1.1.2. If the extension has not been modified to keep up with the changes to the API, then it will fail in ways similar to the error you found. In this case, the number of arguments for the walkchangerevs method has changed.
Updating the extension could be a large task...there is no way to know without inspecting the code. You could try to contact the author (#Ry4an) and ask for help. You could also try to modify the extension yourself.

Categories