# \[TypeError: subject\_info\["birthday"\] must be an instance of date or None, got \<class 'tuple'\> instead.

**URL:** <https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573>\
**Category:** Support & Discussions\
**Created:** [November 6, 2025, 4:52pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573 "2025-11-06T16:52:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 6, 2025, 4:52pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/1 "2025-11-06T16:52:44Z")

</div>

**❓ If you have a question or issue with MNE-Python, please include the following info:**

- MNE version: 1.10.0
- operating system: e.g. macOS Sequoia 15.7.2.

**📄 Please also provide relevant code snippets – ideally a [minimal working example](https://stackoverflow.com/help/minimal-reproducible-example) (MWE).**

After succesfully producing power and itc using the “compute\_tfr” function as follows:

```python
epos = mne.read_epochs(epo_in, preload=True)
epos.pick(picks)
epos.drop_bad(reject = reject_epo)
epos = mne.epochs.combine_event_ids(epos,
[‘ref/-8_proj’,
‘ref/-4_proj’,
‘ref/4_proj’,
‘ref/8_proj’],
{‘ref/comb_proj’: 60})

epos.equalize_event_counts(conds)

_ , itc = epos[c].compute_tfr(method = “morlet”, freqs=freqs, n_cycles=n_cycles,
return_itc=True, average = True)

```

reading the profuced tfr file

```python
tfrs = mne.time_frequency.read_tfrs(fname_in)

```

returns the following error:

```python
Reading //Volumes/neurospin/meg/meg_tmp/2023_egoMEG_Wagelmans/MEG/tfr/ag230213_egoMEG_itc_combpresent-tfr.h5 …

TypeError Traceback (most recent call last)
File /Volumes/meg_tmp/2023_egoMEG_Wagelmans/SCRIPTS/tfr_ref_pipeline/008_TFR_iplot.py:65
61 fname_in = f’{tfr_dir}{subject}egoMEG{meas}_{c_names[0]}-tfr.h5’
64 # %%
—> 65 tfrs = mne.time_frequency.read_tfrs(fname_in)
70 #___plot power
71 # %%
72 tfrs[“ref/0_proj”].plot(picks=[“MEG2431”],
73 baseline = (-0.8, 0),
74 tmin = -0.5,
(…)
79 mode = “logratio”
80 )

File :12, in read_tfrs(fname, condition, verbose)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:4119, in read_tfrs(fname, condition, verbose)
4117 else:
4118 Klass = RawTFR
→ 4119 out = Klass(inst=hdf5_dict)
4120 if getattr(out, “metadata”, None) is not None:
4121 out.metadata = _prepare_read_metadata(out.metadata)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2911, in AverageTFR.init(self, inst, freqs, method, tmin, tmax, picks, proj, decim, comment, n_jobs, verbose, **method_kw)
2909 else:
2910 self._comment = getattr(self, “_comment”, comment)
→ 2911 super().init(
2912 inst,
2913 method,
2914 freqs,
2915 tmin=tmin,
2916 tmax=tmax,
2917 picks=picks,
2918 proj=proj,
2919 decim=decim,
2920 n_jobs=n_jobs,
2921 verbose=verbose,
2922 **method_kw,
2923 )

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:1194, in BaseTFR.init(self, inst, method, freqs, tmin, tmax, picks, proj, decim, n_jobs, reject_by_annotation, verbose, **method_kw)
1192 # triage reading from file
1193 if isinstance(inst, dict):
→ 1194 self.setstate(inst)
1195 return
1196 if method is None or freqs is None:

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2950, in AverageTFR.setstate(self, state)
2948 state[“dims”] += (“taper”,)
2949 state[“dims”] += (“freq”, “time”)
→ 2950 super().setstate(state)
2951 self._comment = state.get(“comment”, “”)
2952 self._nave = state.get(“nave”, 1)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:1436, in BaseTFR.setstate(self, state)
1434 self._raw_times = np.asarray(defaults[“times”], dtype=np.float64)
1435 self._baseline = defaults[“baseline”]
→ 1436 self.info = Info(**defaults[“info”])
1437 self._data_type = defaults[“data_type”]
1438 self._decim = defaults[“decim”]

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1698, in Info.init(self, *args, **kwargs)
1696 for key in (“helium_info”, “subject_info”):
1697 if key in self:
→ 1698 self[key] = self[key]

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:960, in ValidatedDict.setitem(self, key, val)
958 raise RuntimeError(self._attributes[key])
959 else:
→ 960 val = self._attributes[key](
961 val, info=self
962 ) # attribute checker function
963 else:
964 class_name = self.class.name

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1010, in _check_types(x, info, name, types, cast)
1008 _validate_type(x, types, name)
1009 if cast is not None and x is not None:
→ 1010 x = cast(x)
1011 return x

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1053, in SubjectInfo.init(self, initial)
1051 super().init()
1052 for key, val in initial.items():
→ 1053 self[key] = val

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:960, in ValidatedDict.setitem(self, key, val)
958 raise RuntimeError(self._attributes[key])
959 else:
→ 960 val = self._attributes[key](
961 val, info=self
962 ) # attribute checker function
963 else:
964 class_name = self.class.name

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1015, in _check_bday(birthday_input, info)
1014 def _check_bday(birthday_input, *, info):
→ 1015 date = _check_types(
1016 birthday_input,
1017 info=info,
1018 name=‘subject_info[“birthday”]’,
1019 types=(datetime.date, None),
1020 )
1021 # test if we have a pd.Timestamp
1022 if hasattr(date, “date”):

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1008, in _check_types(x, info, name, types, cast)
1007 def _check_types(x, *, info, name, types, cast=None):
→ 1008 _validate_type(x, types, name)
1009 if cast is not None and x is not None:
1010 x = cast(x)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/utils/check.py:645, in _validate_type(item, types, item_name, type_name, extra)
643 _item_name = “Item” if item_name is None else item_name
644 _item_type = type(item) if item is not None else item
→ 645 raise TypeError(
646 f"{_item_name} must be an instance of {type_name}{extra}, "
647 f"got {_item_type} instead."
648 )

TypeError: subject_info[“birthday”] must be an instance of date or None, got <class ‘tuple’> instead.

```

@sophie pointed. to this report [Trouble with measurement dates when anonymizing or writing epochs data · Issue #13154 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/issues/13154) but it doesn’t seem to be identical.

Any pointer much appreciated

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 6, 2025, 5:35pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/2 "2025-11-06T17:35:34Z")

</div>

Hello,

The format of birthday was changed from a tuple to a date object in MNE 1.8. Was the `AverageTFR` ITC file you’re trying to load saved with an old version of MNE (\<1.8)?

I am not able to reproduce this with an object saved on 1.10, but that could be due to something in your `itc.info` or how you are saving the `AverageTFR` object. Please can you provide more info about this if the above point about saving on an old MNE version isn’t the case.

Cheers,  
Thomas

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 6, 2025, 8:40pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/3 "2025-11-06T20:40:58Z")

</div>

Hello Thomas, thank you for your fast and helpful feedback on the matter.

I just computed a tfr file _de novo._ Unfortunately, the error is identical whether the tfr is computed with an outdated version (1.7) or the current version (1.10.1) of mne-python.

```python

Reading //Volumes/.../ipow_combpresent-tfr.h5 …

TypeError Traceback (most recent call last)
File /Volumes/meg_tmp/2023_egoMEG_Wagelmans/SCRIPTS/tfr_ref_pipeline/008_TFR_iplot.py:65
61 fname_in = f’{tfr_dir}{subject}egoMEG{meas}_{c_names[0]}-tfr.h5’
64 #%% load data
—> 65 tfrs = mne.time_frequency.read_tfrs(fname_in)
67 #error subject_info[“birthday”] must be an instance of date or None, got <class ‘tuple’> instead.
68
69 #%% plot data
70 tfrs[“ref/0_proj”].plot(picks=[“MEG2431”],
71 baseline = (-0.8, 0),
72 tmin = -0.5,
(…)
77 mode = “logratio”
78 )

File :12, in read_tfrs(fname, condition, verbose)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:4119, in read_tfrs(fname, condition, verbose)
4117 else:
4118 Klass = RawTFR
 → 4119 out = Klass(inst=hdf5_dict)
4120 if getattr(out, “metadata”, None) is not None:
4121 out.metadata = _prepare_read_metadata(out.metadata)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2911, in AverageTFR.init(self, inst, freqs, method, tmin, tmax, picks, proj, decim, comment, n_jobs, verbose, **method_kw)
2909 else:
2910 self._comment = getattr(self, “_comment”, comment)
 → 2911 super().init(
2912 inst,
2913 method,
2914 freqs,
2915 tmin=tmin,
2916 tmax=tmax,
2917 picks=picks,
2918 proj=proj,
2919 decim=decim,
2920 n_jobs=n_jobs,
2921 verbose=verbose,
2922 **method_kw,
2923 )

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:1194, in BaseTFR.init(self, inst, method, freqs, tmin, tmax, picks, proj, decim, n_jobs, reject_by_annotation, verbose, **method_kw)
1192 # triage reading from file
1193 if isinstance(inst, dict):
 → 1194 self.setstate(inst)
1195 return
1196 if method is None or freqs is None:

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2950, in AverageTFR.setstate(self, state)
2948 state[“dims”] += (“taper”,)
2949 state[“dims”] += (“freq”, “time”)
 → 2950 super().setstate(state)
2951 self._comment = state.get(“comment”, “”)
2952 self._nave = state.get(“nave”, 1)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:1436, in BaseTFR.setstate(self, state)
1434 self._raw_times = np.asarray(defaults[“times”], dtype=np.float64)
1435 self._baseline = defaults[“baseline”]
 → 1436 self.info = Info(**defaults[“info”])
1437 self._data_type = defaults[“data_type”]
1438 self._decim = defaults[“decim”]

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1698, in Info.init(self, *args, **kwargs)
1696 for key in (“helium_info”, “subject_info”):
1697 if key in self:
 → 1698 self[key] = self[key]

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:960, in ValidatedDict.setitem(self, key, val)
958 raise RuntimeError(self._attributes[key])
959 else:
 → 960 val = self._attributes[key](
961 val, info=self
962 ) # attribute checker function
963 else:
964 class_name = self.class.name

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1010, in _check_types(x, info, name, types, cast)
1008 _validate_type(x, types, name)
1009 if cast is not None and x is not None:
 → 1010 x = cast(x)
1011 return x

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1053, in SubjectInfo.init(self, initial)
1051 super().init()
1052 for key, val in initial.items():
 → 1053 self[key] = val

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:960, in ValidatedDict.setitem(self, key, val)
958 raise RuntimeError(self._attributes[key])
959 else:
 → 960 val = self._attributes[key](
961 val, info=self
962 ) # attribute checker function
963 else:
964 class_name = self.class.name

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1015, in _check_bday(birthday_input, info)
1014 def _check_bday(birthday_input, *, info):
 → 1015 date = _check_types(
1016 birthday_input,
1017 info=info,
1018 name=‘subject_info[“birthday”]’,
1019 types=(datetime.date, None),
1020 )
1021 # test if we have a pd.Timestamp
1022 if hasattr(date, “date”):

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/_fiff/meas_info.py:1008, in _check_types(x, info, name, types, cast)
1007 def _check_types(x, *, info, name, types, cast=None):
 → 1008 _validate_type(x, types, name)
1009 if cast is not None and x is not None:
1010 x = cast(x)

File ~/Applications/MNE-Python/1.10.1_0/.mne-python/lib/python3.13/site-packages/mne/utils/check.py:645, in _validate_type(item, types, item_name, type_name, extra)
643 _item_name = “Item” if item_name is None else item_name
644 _item_type = type(item) if item is not None else item
 → 645 raise TypeError(
646 f"{_item_name} must be an instance of {type_name}{extra}, "
647 f"got {_item_type} instead."
648 )

TypeError: subject_info[“birthday”] must be an instance of date or None, got <class ‘tuple’> instead.

```

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 7, 2025, 12:51pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/4 "2025-11-07T12:51:09Z")

</div>

Thanks for checking the versions.

Can you share some data so we can look into this? Could be via a dropbox link or email. The data could be the epochs object you’re creating the ITC from. Alternatively, if you can copy the `Info` to some random data and replicate the issue, you could share this.

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 7, 2025, 2:09pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/5 "2025-11-07T14:09:33Z")

</div>

Yes, I can send you a file securely via Renater FileSender. Is there an email address I can use?

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 7, 2025, 2:12pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/6 "2025-11-07T14:12:30Z")

</div>

You can send it to: [thomas-samuel.binns@charite.de](mailto:thomas-samuel.binns@charite.de)

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 7, 2025, 3:58pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/7 "2025-11-07T15:58:14Z")

</div>

I created a fresh environment with MNE 1.10 and I am able to load the TFR file you sent using `mne.time_frequency.read_tfrs()` without any issues. Can you try reading the file with a fresh environment?

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 7, 2025, 4:14pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/8 "2025-11-07T16:14:41Z")

</div>

This is good news but strange.

Some more info:  
I am using Spyder with the following mne-python version:  
/Users/vv221713/Applications/MNE-Python/1.10.1\_0/.mne-python/bin/python

I work with Mac Sequoia 15.7.2. and cannot/should not upgrade to Catalina

The mne install is very recent and my computer is new from the summer so not much work reinstall made on it yet

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 7, 2025, 6:17pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/9 "2025-11-07T18:17:26Z")

</div>

Okay, so I also created a new environment from the installer for 1.10.2\_0, and I can still load the data without issue.

Code:

```python
import mne
file = "C:\\Users\\tsbin\\Downloads\\ad230259_egoMEG_itc_combpresent-tfr.h5"
itc = mne.time_frequency.read_tfrs(file)
print(itc)

```

Output:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/a/a4b32e3cafa31ebfb5a62984d8dbf452c490c420.png)

Could be there is an issue with your installation of MNE. I would suggest installing 1.10.2\_0 using the latest installer.

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [November 7, 2025, 8:46pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/10 "2025-11-07T20:46:37Z")

</div>

The failing check was introduced in 2025 June, in

> <https://github.com/mne-tools/mne-python/pull/13284>
>
> \#### Reference issue 
> Fixes #13279.
> 
> 
> \#### What does this implement/fix?
> Co…nverts pd.Timestamp subject birthday input to datetime.date
> 
> \`pandas.Timestamp\` were allowed into \`info\['subject\_info'\]\['birthday'\]\` because they \_can\_ be cast into a \`datetime.date\`. This was causing an issue when exporting to a FIFF file because the entry had not been converted to the right type.
> 
> 
> \#### Additional information
> This seems to be specific to the birthday input, \`meas\_date\` has the right checks to prevent pd.Timestamp inputs.

and first appeared in version 1.10.0

Storing `info["subject_info"]["birthday"]` as a datetime object instead of a tuple was behavior first introduced in MNE 1.8:

> <https://github.com/mne-tools/mne-python/pull/12720>
>
> 1. Use \`datetime.date\` for \`info\["subject\_info"\]\["birthday"\]\` rather than a year…/month/day tuple
> 2. Use \`datetime.datetime\` for \`info\["helium\_info"\]\["meas\_date"\]\`
> 3. Fix in-memory anonymization for EDF by deleting \`edf\_info\["subject\_info"\]\` and \`edf\_info\["meas\_date"\]\`
> 
> Closes #11966
> Closes #11327

I suspect what’s going on is that:

1. the _epochs_ were created with a version prior to 1.8, and
2. we never updated the `read_epochs` code path to convert birthday tuples to datetime objects, and
3. when the TFR is created from the Epochs, `info["subject_info"]` is copied over untouched
4. the TFR writer is still writing tuples because it’s writing to HDF5 (not FIFF) and so the safeguards added in #12720 aren’t kicking in.

@virvw is the file you emailed to @tsbinns an anonymized one that you just saved? If so (and if my earlier speculations are correct), it probably will have a datetime birthday instead of a tuple one, which would explain why he can’t reproduce your errors.

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 7, 2025, 9:26pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/11 "2025-11-07T21:26:45Z")

</div>

Thank you for your help @tsbinns

I can now replicate opening directly in the python cmd line on the Linux server w/ an old mne-python version

```python
>>> file = "ad230259_egoMEG_itc_combpresent-tfr.h5"
>>> itc = mne.time_frequency.read_tfrs(file)
Reading /neurospin/meg/...
>>> print(itc)
<Inter-trial coherence from Epochs (nave=91), morlet method | 306 channels × 121 freqs × 5501 times, 0.3 - 120.0 Hz, -0.50 - 5.00 s, 1.52 GiB>

```

The good news is that the code is effectively working.

I installed the latest mne-python on my Mac and unfortunately the same error comes up. Spyder may be the culprit…

So the bad news is that interfaces / IDE go faster than I can keep up with. I’ll tryVSCode and Pycharm

Best,

Virginie

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 7, 2025, 10:09pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/12 "2025-11-07T22:09:11Z")

</div>

Hi again -

I installed VSCode and tried. I am experiencing the same error there when reading the file (using the same file and the same code).

Maybe an IDE or python version issue (Python 3.13.8)?

mne-python 1.10.2

```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[5], line 2
      1 #%% load data
----> 2 tfrs = mne.time_frequency.read_tfrs(fname_in)[0]
      4 #error subject_info["birthday"] must be an instance of date or None, got <class 'tuple'> instead.

File <decorator-gen-179>:12, in read_tfrs(fname, condition, verbose)

File ~/Applications/MNE-Python/1.10.2_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:4119, in read_tfrs(fname, condition, verbose)
   4117 else:
   4118 Klass = RawTFR
-> 4119 out = Klass(inst=hdf5_dict)
   4120 if getattr(out, "metadata", None) is not None:
   4121 out.metadata = _prepare_read_metadata(out.metadata)

File ~/Applications/MNE-Python/1.10.2_0/.mne-python/lib/python3.13/site-packages/mne/time_frequency/tfr.py:2911, in AverageTFR. __init__ (self, inst, freqs, method, tmin, tmax, picks, proj, decim, comment, n_jobs, verbose, **method_kw)
   2909 else:
   2910 self._comment = getattr(self, "_comment", comment)
-> 2911 super(). __init__ (
   2912 inst,
   2913 method,
   2914 freqs,
   2915 tmin=tmin,
   2916 tmax=tmax,

...

    646 f"{_item_name} must be an instance of {type_name}{extra}, "
    647 f"got {_item_type} instead."
    648 )

TypeError: subject_info["birthday"] must be an instance of date or None, got <class 'tuple'> instead.

Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

```

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 9, 2025, 5:04pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/13 "2025-11-09T17:04:25Z")

</div>

Hello - following up on this, I ran a simpler code on less data to fasten the troubleshooting.

I systematically replicate :

- the produced TFR can be read directly from shell python but both Spyder and Visual VS code report the same errors

- on this simplified version of the data, I get a different error on Spyder and VS Code

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 9, 2025, 5:30pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/14 "2025-11-09T17:30:15Z")

</div>

The TFR file does have a datetime birthday when I read it. However, @virvw also sent me the epochs file, and here I also see a datetime birthday, can compute, save, and load the TFR no problem.

Still, @drammock’s point that I can’t reproduce this because the files (epochs and TFR) were ones you anonymised and just saved could still be the case.

@virvw Are the epochs files you sent me the _ **exact** _ same ones you are using to create the TFR object? And is the TFR file you sent me the _ **exact** _ same one you are trying to load?

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 9, 2025, 5:33pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/15 "2025-11-09T17:33:21Z")

</div>

@tsbinns Thanks for following up on this.

Yes, I confirm these are the **exact** same ones.

Yesterday I tried the anonymize function on the epoch data to see if it changed anything but it didn’t (beside anonymizing of course).

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 9, 2025, 5:33pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/16 "2025-11-09T17:33:46Z")

</div>

@virvw In the terminal where you are able to load that new TFR file, please can you run the following code `mne.sys_info()` and `tfrs.info["subject_info"]["birthday"]`, and paste the output here.

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 9, 2025, 5:39pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/17 "2025-11-09T17:39:06Z")

</div>

Sure here you are:

```python
>>> mne.sys_info()

Platform Linux-5.15.0-157-generic-x86_64-with-glibc2.35

Python 3.11.6 (main, Nov 24 2023, 13:31:23) [GCC 11.4.0]

Executable /neurospin/unicog/resources/pyenv/versions/VvW_1.0.0/bin/python

CPU Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (64 cores)

Memory 93.0 GiB

Core

├☑ mne 1.10.2 (latest release)

├☑ numpy 2.3.4 (unknown linalg bindings (threadpoolctl module not found: No module named 'threadpoolctl'))

├☑ scipy 1.16.3

└☑ matplotlib 3.10.7 (backend=agg)

Numerical (optional)

├☑ pandas 2.3.3

├☑ h5io 0.2.5

├☑ h5py 3.15.1

└☐ unavailable sklearn, numba, nibabel, nilearn, dipy, openmeeg, cupy

Visualization (optional)

└☐ unavailable pyvista, pyvistaqt, vtk, qtpy, ipympl, pyqtgraph, mne-qt-browser, ipywidgets, trame_client, trame_server, trame_vtk, trame_vuetify

Ecosystem (optional)

└☐ unavailable mne-bids, mne-nirs, mne-features, mne-connectivity, mne-icalabel, mne-bids-pipeline, neo, eeglabio, edfio, mffpy, pybv

```

And for

```python

>>> tfrs.info["subject_info"]["birthday"]

datetime.date(2004, 4, 1)

```

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 9, 2025, 5:45pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/18 "2025-11-09T17:45:53Z")

</div>

Thanks for that.  
And what does `mne.sys_info()` look like for you the environment in Spyder or VS Code where you were unable to load the TFR object?

---

<div class="post-metadata">

**Author:** ![virvw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/virvw/32/37_2.png) [@virvw](https://mne.discourse.group/u/virvw)\
**Post date:** [November 9, 2025, 5:50pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/19 "2025-11-09T17:50:52Z")

</div>

It looks like this

```python
mne.sys_info()
Platform macOS-15.7.2-arm64-arm-64bit-Mach-O
Python 3.13.8 | packaged by conda-forge | (main, Oct 13 2025, 14:39:11) [Clang 19.1.7]
Executable /Users/vv221713/Applications/MNE-Python/1.10.2_0/.mne-python/bin/python
CPU Apple M4 Pro (14 cores)
Memory 24.0 GiB

Core
├☑ mne 1.10.2 (latest release)
├☑ numpy 2.2.6 (OpenBLAS 0.3.28 with 14 threads)
├☑ scipy 1.15.2
└☑ matplotlib 3.10.6 (backend=tkagg)

Numerical (optional)
├☑ sklearn 1.7.2
├☑ numba 0.62.1
├☑ nibabel 5.3.2
├☑ nilearn 0.12.1
├☑ dipy 1.11.0
├☑ openmeeg 2.5.15
├☑ pandas 2.3.3
├☑ h5io 0.2.5
├☑ h5py 3.14.0
└☐ unavailable cupy

Visualization (optional)
├☑ pyvista 0.46.3 (OpenGL 4.1 Metal - 89.4 via Apple M4 Pro)
├☑ pyvistaqt 0.11.3
├☑ vtk 9.4.2
├☑ qtpy 2.4.3 (PySide6=6.9.0)
├☑ ipympl 0.9.8
├☑ pyqtgraph 0.13.7
├☑ mne-qt-browser 0.7.2
├☑ ipywidgets 8.1.7
├☑ trame_client 3.11.2
├☑ trame_server 3.6.3
├☑ trame_vtk 2.10.0
└☑ trame_vuetify 3.1.0

Ecosystem (optional)
├☑ mne-bids 0.17.0
├☑ mne-nirs 0.7.2
├☑ mne-features 0.3
├☑ mne-connectivity 0.7.0
├☑ mne-icalabel 0.8.0
├☑ mne-bids-pipeline 1.9.0
├☑ neo 0.14.1
├☑ eeglabio 0.1.2
├☑ edfio 0.4.10
├☑ mffpy 0.10.0
└☑ pybv 0.7.6

```

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [November 9, 2025, 6:26pm UTC](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573/20 "2025-11-09T18:26:15Z")

</div>

Okay, sorry if I am repeating myself, but just to be 100% sure:

If you run the code below to load the TFR file _ **you sent to me** _ in the same environment as that latest message (the one with this `mne.sys_info()` output), you get the error below?

```python
Platform macOS-15.7.2-arm64-arm-64bit-Mach-O
Python 3.13.8 | packaged by conda-forge | (main, Oct 13 2025, 14:39:11) [Clang 19.1.7]
Executable /Users/vv221713/Applications/MNE-Python/1.10.2_0/.mne-python/bin/python
CPU Apple M4 Pro (14 cores)
Memory 24.0 GiB

Core
├☑ mne 1.10.2 (latest release)
├☑ numpy 2.2.6 (OpenBLAS 0.3.28 with 14 threads)
├☑ scipy 1.15.2
└☑ matplotlib 3.10.6 (backend=tkagg)

```

Code:

```python
import mne
file = "your\\file\\path\\here\\ad230259_egoMEG_itc_combpresent-tfr.h5"
itc = mne.time_frequency.read_tfrs(file)
print(itc)

```

Error:  
`TypeError: subject_info["birthday"] must be an instance of date or None, got <class 'tuple'> instead.`

[Next page](https://mne.discourse.group/t/typeerror-subject-info-birthday-must-be-an-instance-of-date-or-none-got-class-tuple-instead/11573.md?page=2)
