Closed nrosjat closed 6 years ago
This one is a bit weird. Are you on Windows?
Can you change line 509 of mne/time_frequency/multitaper.py
from:
n_times = x.shape[-1]
to
n_times = int(x.shape[-1])
To see if it fixes the problem?
Are you on Windows?
Yes I am using Windows 7 (64-Bit).
To see if it fixes the problem?
I changed the line accordingly, but the error still remains the same.
If I skip this step and move on to the artifact detection using EOG information multitaper.py produces another error:
File "...\py27\lib\site-packages\mne\time_frequency\multitaper.py", line 509, in psd_array_multitaper dshape = int(x.shape[:-1]) TypeError: int() argument must be a string or a number, not 'tuple'
windows does not use standard int64. One fix is certain to do a np.astype somewhere but for this you need to debug after putting a breakpoint at the right place.
what is the value of sr.dtype ?
what is the value of sr.dtype ?
The value of sr.dtype is int64
Somehow the tuple select_range from multitaper.py (line 201) ends up as a dstype = int64 via np.asarray(select_range)?
no idea
I checked for sr.dtype.char.lower() and it is set to 'q' which is not in 'lih'. When adding q to the string the correct figure would be produced.
If I just create the numpyarray manually and check for dtype.char I get the following:
sr.astype(np.int64) Out[21]: array([1], dtype=int64)
sr.dtype.char.lower() Out[22]: 'l'
I have no idea why the type is 'q' in one case, but 'l' in the other.
Me neither, but let's go ahead and add it to the list (it's c long long
equiv)
https://docs.scipy.org/doc/numpy-1.13.0/reference/arrays.scalars.html
... oh wait it's in a SciPy function. You need to cast it in MNE to make it happy, maybe pass np.int64(N)
or something?
BTW doing sr.astype(np.int64)
returns something, it does not change sr
in place
After adding np.int64(N) to line 201 in multitaper.py the value error is solved:
w = linalg.eigvals_banded(ab, select='i', select_range=(np.int64(N) - Kmax, np.int64(N) - 1))
How can I fix this issue? I am struggling with the same problem!
how do we replicate? can you replicate on sample data?
Yes, both sample data using this script https://martinos.org/mne/stable/auto_examples/preprocessing/plot_run_ica.html#sphx-glr-auto-examples-preprocessing-plot-run-ica-py and on my data give me the same issue mentioned before. I changed those lines suggested by nrosjat in the multitaper.py file, but I keep getting the same value error.
`--------------------------------------------------------------------------- ValueError Traceback (most recent call last)
This is the error I get when trying to plot ica properties. Do I have another way to reach that data?
I get the same error when trying to run https://www.martinos.org/mne/stable/auto_examples/connectivity/plot_sensor_connectivity.html#sphx-glr-auto-examples-connectivity-plot-sensor-connectivity-py
what does:
mne.sys_info()
return on your system? what OS are you using? win32 or win64?
In [2]: mne.sys_info() D:\Users\Davide\Anaconda2\lib\site-packages\h5py__init__.py:36: FutureWarning:
Conversion of the second argument of issubdtype from float
to np.floating
is
deprecated. In future, it will be treated as np.float64 == np.dtype(float).typ e
.
Platform: Windows-7-6.1.7601-SP1 Python: 2.7.14 |Anaconda, Inc.| (default, Nov 8 2017, 13:40:45) [MSC v.1 500 64 bit (AMD64)] Executable: D:\Users\Davide\Anaconda2\python.exe CPU: Intel64 Family 6 Model 42 Stepping 7, GenuineIntel: 4 cores Memory: 7.9 GB
mne: 0.15.2 numpy: 1.14.0 {lapack=mkl_rt, blas=mkl_rt} scipy: 1.0.0 matplotlib: 2.1.2
sklearn: 0.19.1 nibabel: 2.2.1 mayavi: 4.5.0 pycuda: Not found skcuda: Not found pandas: 0.22.0
@nrosjat @Davi93 can you check to see if #5039 fixes your problem?
ValueError Traceback (most recent call last)
Same for me. I get the same error again after replacing my changes by the fix.
@larsoner I think it worked for me but I know get this error: RuntimeError: Invalid Qt API 'pyqt5', valid values are: 'pyqt' or 'pyside'. I guess is not related with the previous issue though.
Can you try our latest and greatest updated conda
environment (merged today or yesterday):
https://github.com/mne-tools/mne-python/blob/master/environment.yml
I have managed to build that environment in miniconda. I do not get any error now, but the mayavi window that should show the connectivity results just stucks as soon as it appears and crashes.
I am also struggling in creating the environment with the yml file, anaconda seems to stuck somewhere as some packages are not installed (as mne or all the packages listed after it, such as mayavi for example).
ps. I uninstalled and reinstalled anaconda and miniconda before doing it.
Now using miniconda and ipython, even simple functions as raw.plot are not working, the windows are not responding and crashing. The raw.plot function is instead working if I use a python terminal, but I get an error when trying to do: "from mayavi import mlab" (from the sensor connectivity script). In Ipython I don't get this error, but the output windows are not working.
Grrrr
Can you try pip install --upgrade --no-deps pyqt
to see if this fixes it?
"Could not find a version that satisfies the requirement pyqt (from versions: ) No matching distribution found for pyqt You are using pip version 9.0.1, however version 9.0.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' comm and." :/
Sorry, I meant pyqt5
. Are you on gitter
? We could iterate there more easily.
After installing the pre-mentioned environment (https://github.com/mne-tools/mne-python/blob/master/environment.yml) I was still having problems with 3d visualization. The Mayavi window was not showing anything/freezing. I also get an error message from another window stating: "GL version 2.1 with the gpu_shader4 extension is not supported by your graphics driver but is required for the new OpenGL rendering backend. Please update your OpenGL driver. If you are using Mesa please make sure you have version 10.6.5 or later and make sure your driver in Mesa supports OpenGL 3.2.".
The issue was solved as suggested by Larsoner, using the %gui qt tweak and by making python using the NVIDIA card in Intel/NVIDIA switchable graphics feature as following: in the NVIDIA control panel IIRC you should set which programs use the GPU and add the python.exe from your env (e.g., C:\Users\whoever\miniconda3\envs\mne\bin\python.exe). You should add Ipython.exe and Spider.exe as well. That worked for me.
Thanks for the feedback. This should be added to our install doc
can you try to insert these info in this file:
https://raw.githubusercontent.com/mne-tools/mne-python/master/doc/install_mne_python.rst
I can take care of reviewing and pushing it in the mne doc later.
Actually I think it would fit better in faq.rst
, maybe with a clearer link from the main install_mne_python.rst
. We don't want that install page to become the landing page for every possible system config / install problem.
fine with me
I'm trying to follow the Artifact Correction with ICA example with Python 2.7.14 under Spyder in 64-bit mode (conda version 4.3.29). Everything works as expected until:
ica.plot_properties(raw, picks=0)
which leads to an ValueError.
I'm quite new to Python, but I guess it has something to do with using the 64-bit version? I tried it with 32-bit mode, but then I ended up with a MemoryError. Does anyone have a suggestion on how to resolve this problem?