models icon indicating copy to clipboard operation
models copied to clipboard

v2.12.0 did not support python 3.11

Open guizili0 opened this issue 2 years ago • 11 comments

I run RN50 training with command: python train.py
--model_dir=$model_dir
--mode=train_and_eval
--config_file=imagenet_resnet50_tpu.yaml
--experiment=image_classification

Got below issue: raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'official.modeling.optimization.configs.optimizer_config.SGDConfig'> for field sgd is not allowed: use default_factory

guizili0 avatar Mar 31 '23 02:03 guizili0

Hi @guizili0 ,

In order to expedite the trouble-shooting process, please provide a code snippet/colab code to reproduce the issue reported here.

Meanwhile please check this gist which is image classification with gpu config which is trained without any error, let us know if this helps you.

Thanks!

laxmareddyp avatar Apr 04 '23 18:04 laxmareddyp

@laxmareddyp This issue is from python 3.11, do you know how to change the python version in colab?

guizili0 avatar Apr 08 '23 01:04 guizili0

Hi @guizili0 ,

Thanks for bringing this issue to our notice, we are working on it internally and let you know asap.

Thanks.

laxmareddyp avatar Apr 10 '23 22:04 laxmareddyp

Any update for this issue?

wendyliu235 avatar Jul 19 '23 06:07 wendyliu235

I am waiting for this to be resolved too.

jinmiyoon avatar Jul 24 '23 19:07 jinmiyoon

Hi, @laxmareddyp Any updates on this ? We have the same issue with python 3.11.

Additionally, do you maybe know if there are some works on bumping pyyaml to >=6.0 in the requirements.text for the TF official packages ?

This file: https://github.com/tensorflow/models/blob/master/official/requirements.txt

has constraint:

# Loader becomes a required positional argument in 6.0 in yaml.load
pyyaml>=5.1,<5.4.0

This is also problematic for python 3.11. Thanks

kmkolasinski avatar Aug 09 '23 16:08 kmkolasinski

Hi @kmkolasinski,

Sure, Let me check with the team for bumping the version is feasible or not.

Thanks.

laxmareddyp avatar Aug 09 '23 18:08 laxmareddyp

Hi @laxmareddyp thank you, just for your information the issue

ValueError: mutable default <class 'official.modeling.optimization.configs.optimizer_config.SGDConfig'> for field sgd is not allowed: use default_factory

seems to be handled in the newest version of tf-official-models 2.13, but this version requires tensorflow-text==2.13 which cannot be installed from pip with python 3.11 (there are no wheels for py311)

ERROR: Could not find a version that satisfies the requirement tensorflow-text==2.13 (from versions: 2.12.0rc0, 2.12.0, 2.12.1, 2.13.0rc0)
ERROR: No matching distribution found for tensorflow-text==2.13

kmkolasinski avatar Aug 10 '23 05:08 kmkolasinski

Hi, Did anyone resolve this error??

Spoortitondihal2 avatar Aug 17 '23 07:08 Spoortitondihal2

Nope, not yet, I would prefer to use the right approach before hacking. @laxmareddyp any news on this ?

@Spoortitondihal2 note that the main error disappear if you will use 2.13, but this causes issues with tensorflow-text==2.13 which does not work with py3.11. For python <3.10 you should be able to use tf-models-official==2.11.0 with TF 211

kmkolasinski avatar Aug 17 '23 08:08 kmkolasinski

This should be resolved since Python 3.11 support seems pretty well broken.

ujjwalnur avatar Sep 18 '23 12:09 ujjwalnur