Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Unknown interpolation method 'cubic' for 3 dimensional data #27

Closed
maciejkos opened this issue Apr 3, 2018 · 3 comments
Closed

Comments

@maciejkos
Copy link

Hi,

I am getting the following error and was wondering if you could help me fix it. I am using the sample data you provided.

Thanks!
-Maciej

Traceback (most recent call last):
  File "C:/Users/Christine/PycharmProjects/EEG_VM/main.py", line 15, in <module>
    images = eeglib.gen_images(locs, features, nGridPoints)
  File "C:\Users\Christine\Anaconda3\envs\EEG_VM\lib\site-packages\eeglearn\eeg_cnn_lib.py", line 96, in gen_images
    method='cubic', fill_value=np.nan)
  File "C:\Users\Christine\Anaconda3\envs\EEG_VM\lib\site-packages\scipy\interpolate\ndgriddata.py", line 225, in griddata
    "%d dimensional data" % (method, ndim))
ValueError: Unknown interpolation method 'cubic' for 3 dimensional data

main.py

import eeglearn
import eeglearn.eeg_cnn_lib as eeglib
import numpy as np

import scipy.io as sio # need this to load mat files

# load data
locs_raw = sio.loadmat("./sample_data/Neuroscan_locs_orig.mat")
locs = locs_raw['A']
features_raw = sio.loadmat("./sample_data/FeatureMat_timeWin.mat")
features = features_raw['features']
features = features[:, 0:-1] # remove the last column; otherwise, assert features.shape[1] % nElectrodes == 0  gives AssertionError
nGridPoints = 100

images = eeglib.gen_images(locs, features, nGridPoints)
eeglib.train(images, labels, train_test_fold, model_type)

EEGLearn_files.zip

@pbashivan
Copy link
Owner

Are you able to run the following?

import eeglearn
import eeglearn.eeg_cnn_lib as eeglib

images = eeglib.gen_images(locs, features, nGridPoints)
eeglib.train(images, labels, train_test_fold, model_type)

@maciejkos
Copy link
Author

maciejkos commented Apr 12, 2018

Thanks for the reply. Running this code produces the following error:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2017.3.3\helpers\pydev\pydev_run_in_console.py", line 53, in run_file
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:/Users/Christine/PycharmProjects/EEG_VM/mail-old.py", line 4, in <module>
    images = eeglib.gen_images(locs, features, nGridPoints)
NameError: name 'locs' is not defined

This is why I started modifying it (see my first post).

@pbashivan
Copy link
Owner

Right, it should fail as you said.
Try the following:

python eeg_cnn_lib.py

this should run and use the sample data to generate images and train the network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants