# Problem when fitting an AutoReject object on epochs

**URL:** <https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341>\
**Category:** Support & Discussions\
**Tags:** preprocessing, autoreject\
**Created:** [February 15, 2024, 4:05pm UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341 "2024-02-15T16:05:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nissauce](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/nissauce/32/3052_2.png) [@nissauce](https://mne.discourse.group/u/nissauce)\
**Post date:** [February 15, 2024, 4:05pm UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341/1 "2024-02-15T16:05:27Z")

</div>

Hello,

I’m using mne 1.6.0 and autoreject 0.4.3 on MacOS big sure 11.7.10

I followed the [autoreject and ICA workflow example](https://autoreject.github.io/stable/auto_examples/plot_autoreject_workflow.html) and I get an attribute error message that I don’t understand when fitting an AutoReject object on my epochs.

```python
ar = autoreject.AutoReject(n_interpolate=[1, 2, 3, 4], random_state=11,
                        n_jobs=2, verbose=True)
ar.fit(epochs[:10]) 

```

```python
AttributeError: No mne.io attribute meas_info

```

I searched in the doc what was this meas\_info but I didn’t find anything. I also tried with different versions (mne 1.4, 1.5 and autoreject 1.3.0, 1.4.1, 1.4.2, 1.4.3) but with no success.

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [February 15, 2024, 5:13pm UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341/2 "2024-02-15T17:13:21Z")

</div>

Hello @nissauce and welcome to the forum

Could you please share the entire traceback (the usually quite long list of error messages) you receive, not just the very last one?

Richard

---

<div class="post-metadata">

**Author:** ![nissauce](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/nissauce/32/3052_2.png) [@nissauce](https://mne.discourse.group/u/nissauce)\
**Post date:** [February 16, 2024, 2:50pm UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341/3 "2024-02-16T14:50:54Z")

</div>

Hello Richard, thanks!

Here it is:

```python
Traceback (most recent call last):
  File "/path/to/proj/debug_autoreject.py", line 11, in <module>
    ar.fit(epochs[:10]) 
  File "/Users/nicolaspiron/opt/anaconda3/envs/pulsation_proj/lib/python3.8/site-packages/autoreject/autoreject.py", line 1004, in fit
    _check_data(epochs, picks=self.picks_, verbose=self.verbose)
  File "/Users/nicolaspiron/opt/anaconda3/envs/pulsation_proj/lib/python3.8/site-packages/autoreject/utils.py", line 42, in _check_data
    ch_types_picked = {
  File "/Users/nicolaspiron/opt/anaconda3/envs/pulsation_proj/lib/python3.8/site-packages/autoreject/utils.py", line 43, in <setcomp>
    mne.io.meas_info.channel_type(picked_info, idx)
  File "/Users/nicolaspiron/opt/anaconda3/envs/pulsation_proj/lib/python3.8/site-packages/lazy_loader/ __init__.py", line 89, in __getattr__
    raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No mne.io attribute meas_info

```

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [February 16, 2024, 5:40pm UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341/4 "2024-02-16T17:40:21Z")

</div>

Maybe @sappelhoff has an idea?

---

<div class="post-metadata">

**Author:** ![sappelhoff](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/sappelhoff/32/3276_2.png) [@sappelhoff](https://mne.discourse.group/u/sappelhoff)\
**Post date:** [February 19, 2024, 10:39am UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341/5 "2024-02-19T10:39:14Z")

</div>

I think you need to upgrade your software versions of autoreject and mne to the latest available stable versions (not development, not old).

---

<div class="post-metadata">

**Author:** ![nissauce](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/nissauce/32/3052_2.png) [@nissauce](https://mne.discourse.group/u/nissauce)\
**Post date:** [February 19, 2024, 11:49am UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341/6 "2024-02-19T11:49:07Z")

</div>

I did it (1.6.1 for mne, 0.4.2 for autoreject) and I get the same error.

---

<div class="post-metadata">

**Author:** ![nissauce](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/nissauce/32/3052_2.png) [@nissauce](https://mne.discourse.group/u/nissauce)\
**Post date:** [February 19, 2024, 1:07pm UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341/7 "2024-02-19T13:07:27Z")

</div>

You were right, autoreject 0.4.3 works, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [February 26, 2024, 1:07pm UTC](https://mne.discourse.group/t/problem-when-fitting-an-autoreject-object-on-epochs/8341/8 "2024-02-26T13:07:51Z")

</div>

Closed on February 26, 2024, 1:07pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
