Problem with Compute coherence in source space MNE Example

Hi guys!
I’m kind of new to MNE and I’m still getting the hang of a few things :)~
I was trying to follow the example Compute coherence in source space using a MNE inverse solution — MNE-Connectivity 0.5.0 documentation

but I keep getting problems when calculating my channel sources…
I’m using EEG data with 63 channels and I’ve calculated the inverse operator with the EEG forward operator example.

the code I have is this:

fwd = mne.make_forward_solution(
    raw.info, trans=trans, src=src, bem=bem, eeg=True, mindist=5.0, n_jobs=None
)
inverse_operator = make_inverse_operator(raw.info, fwd, cov, loose=0.0, depth=0.8, verbose=True)
# Read epochs.
epochs = mne.make_fixed_length_epochs(raw, duration=15)

#%%

snr = 3.0
lambda2 = 1.0 / snr ** 2
evoked = epochs.average()
stc = apply_inverse(evoked, inverse_operator, lambda2, method=method, verbose=True,pick_ori="normal")

I am getting the error message in the last line - “cannot reshape array of size 61452 into shape (20484,3,3)”
and I dont understand how to fix this :frowning: does anyone know what I should do? Thanks!!

  • MNE version: e.g. 1.4.0
  • operating system: Windows 10

can you provide the full code? What is fwd and src? Do you have fwd[“src”] that is the same as src?

Alex