google / seqio

Task-based datasets, preprocessing, and evaluation for sequence models.
Apache License 2.0
564 stars 58 forks source link

ValueError: mutable default <class 'seqio.vocabularies.PassThroughVocabulary'> for field vocabulary is not allowed: use default_factory #562

Open jli262 opened 1 year ago

jli262 commented 1 year ago

Traceback (most recent call last): File "/scenic/scenic/projects/vid2seq/vid2seq_test.py", line 13, in from scenic.projects.vid2seq import trainer File "/anaconda3/envs/vid2seq/lib/python3.11/site-packages/scenic/projects/vid2seq/trainer.py", line 26, in from scenic.projects.t5 import model as t5_model File "/anaconda3/envs/vid2seq/lib/python3.11/site-packages/scenic/projects/t5/model.py", line 29, in from scenic.projects.t5 import layers File "/anaconda3/envs/vid2seq/lib/python3.11/site-packages/scenic/projects/t5/layers.py", line 9, in from t5x import decoding File "/anaconda3/envs/vid2seq/lib/python3.11/site-packages/t5x/init.py", line 17, in import t5x.adafactor File "/anaconda3/envs/vid2seq/lib/python3.11/site-packages/t5x/adafactor.py", line 64, in from t5x import utils File "/anaconda3/envs/vid2seq/lib/python3.11/site-packages/t5x/utils.py", line 44, in import seqio File "/anaconda3/envs/vid2seq/lib/python3.11/site-packages/seqio/init.py", line 18, in from seqio.dataset_providers import * File "/anaconda3/envs/vid2seq/lib/python3.11/site-packages/seqio/dataset_providers.py", line 60, in @dataclasses.dataclass(frozen=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/anaconda3/envs/vid2seq/lib/python3.11/dataclasses.py", line 1213, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/anaconda3/envs/vid2seq/lib/python3.11/dataclasses.py", line 958, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/anaconda3/envs/vid2seq/lib/python3.11/dataclasses.py", line 815, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'seqio.vocabularies.PassThroughVocabulary'> for field vocabulary is not allowed: use default_factory

jli262 commented 1 year ago

anyone meets this problem when implementing t5?

igor17400 commented 1 year ago

I had the same error. Did you manage to figure out @jli262 ?

zbl94 commented 1 year ago

Same error here