Skip to content

AttributeError: 'GO1ModelConfig' object has no attribute 'initializer_range'Β #126

@Yunchen0930

Description

@Yunchen0930

how to solve this issue?
[WARNING|modeling_utils.py:2376] 2025-12-03 14:41:42,429 >> InternLM2ForCausalLM has generative capabilities, as prepare_inputs_for_generation is explicitly defined. However, it doesn't directly inherit from GenerationMixin. From πŸ‘‰v4.50πŸ‘ˆ onwards, PreTrainedModel will NOT inherit from GenerationMixin, and this model will lose the ability to call generate and other related functions.

  • If you're using trust_remote_code=True, you can get rid of this warning by loading the model with an auto class. See https://huggingface.co/docs/transformers/en/model_doc/auto#auto-classes
  • If you are the owner of the model architecture code, please modify your model class such that it inherits from GenerationMixin (after PreTrainedModel, otherwise you'll get an exception).
  • If you are not the owner of the model architecture class, please contact the model code owner to update it.
    [WARNING|modeling_utils.py:2376] 2025-12-03 14:41:42,429 >> InternLM2ForCausalLMGO1 has generative capabilities, as prepare_inputs_for_generation is explicitly defined. However, it doesn't directly inherit from GenerationMixin. From πŸ‘‰v4.50πŸ‘ˆ onwards, PreTrainedModel will NOT inherit from GenerationMixin, and this model will lose the ability to call generate and other related functions.
  • If you're using trust_remote_code=True, you can get rid of this warning by loading the model with an auto class. See https://huggingface.co/docs/transformers/en/model_doc/auto#auto-classes
  • If you are the owner of the model architecture code, please modify your model class such that it inherits from GenerationMixin (after PreTrainedModel, otherwise you'll get an exception).
  • If you are not the owner of the model architecture class, please contact the model code owner to update it.
    [INFO|modeling_utils.py:2341] 2025-12-03 14:41:44,784 >> Instantiating ActionExpertModel model under default dtype torch.bfloat16.
    [rank0]: Traceback (most recent call last):
    [rank0]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 486, in
    [rank0]: main(
    [rank0]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 408, in main
    [rank0]: tokenizer, model = build_go1_model(dataset_args, model_args, training_args, space_args)
    [rank0]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 283, in build_go1_model
    [rank0]: model = GO1Model.from_pretrained(
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 277, in _wrapper
    [rank0]: return func(*args, **kwargs)
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5048, in from_pretrained
    [rank0]: ) = cls._load_pretrained_model(
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5362, in _load_pretrained_model
    [rank0]: model._initialize_missing_keys(missing_keys + mismatched_keys, is_quantized)
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5894, in _initialize_missing_keys
    [rank0]: self.initialize_weights()
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    [rank0]: return func(*args, **kwargs)
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2984, in initialize_weights
    [rank0]: self.smart_apply(self._initialize_weights)
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2975, in smart_apply
    [rank0]: module.smart_apply(module._initialize_weights)
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2978, in smart_apply
    [rank0]: fn(self)
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2952, in _initialize_weights
    [rank0]: self._init_weights(module)
    [rank0]: File "/data2/yc/AgiBot-World/go1/internvl/model/go1/modeling_action_expert.py", line 513, in _init_weights
    [rank0]: std = self.config.initializer_range
    [rank0]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/configuration_utils.py", line 207, in getattribute
    [rank0]: return super().getattribute(key)
    [rank0]: AttributeError: 'GO1ModelConfig' object has no attribute 'initializer_range'
    [rank0]:[W1203 14:41:45.627508439 ProcessGroupNCCL.cpp:1496] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())
    [rank3]: Traceback (most recent call last):
    [rank3]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 486, in
    [rank3]: main(
    [rank3]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 408, in main
    [rank3]: tokenizer, model = build_go1_model(dataset_args, model_args, training_args, space_args)
    [rank3]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 283, in build_go1_model
    [rank3]: model = GO1Model.from_pretrained(
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 277, in _wrapper
    [rank3]: return func(*args, **kwargs)
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5048, in from_pretrained
    [rank3]: ) = cls._load_pretrained_model(
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5362, in _load_pretrained_model
    [rank3]: model._initialize_missing_keys(missing_keys + mismatched_keys, is_quantized)
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5894, in _initialize_missing_keys
    [rank3]: self.initialize_weights()
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    [rank3]: return func(*args, **kwargs)
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2984, in initialize_weights
    [rank3]: self.smart_apply(self._initialize_weights)
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2975, in smart_apply
    [rank3]: module.smart_apply(module._initialize_weights)
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2978, in smart_apply
    [rank3]: fn(self)
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2952, in _initialize_weights
    [rank3]: self._init_weights(module)
    [rank3]: File "/data2/yc/AgiBot-World/go1/internvl/model/go1/modeling_action_expert.py", line 513, in _init_weights
    [rank3]: std = self.config.initializer_range
    [rank3]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/configuration_utils.py", line 207, in getattribute
    [rank3]: return super().getattribute(key)
    [rank3]: AttributeError: 'GO1ModelConfig' object has no attribute 'initializer_range'
    [rank2]: Traceback (most recent call last):
    [rank2]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 486, in
    [rank2]: main(
    [rank2]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 408, in main
    [rank2]: tokenizer, model = build_go1_model(dataset_args, model_args, training_args, space_args)
    [rank2]: File "/data2/yc/AgiBot-World/go1/internvl/train/go1_train.py", line 283, in build_go1_model
    [rank2]: model = GO1Model.from_pretrained(
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 277, in _wrapper
    [rank2]: return func(*args, **kwargs)
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5048, in from_pretrained
    [rank2]: ) = cls._load_pretrained_model(
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5362, in _load_pretrained_model
    [rank2]: model._initialize_missing_keys(missing_keys + mismatched_keys, is_quantized)
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 5894, in _initialize_missing_keys
    [rank2]: self.initialize_weights()
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    [rank2]: return func(*args, **kwargs)
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2984, in initialize_weights
    [rank2]: self.smart_apply(self._initialize_weights)
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2975, in smart_apply
    [rank2]: module.smart_apply(module._initialize_weights)
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2978, in smart_apply
    [rank2]: fn(self)
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2952, in _initialize_weights
    [rank2]: self._init_weights(module)
    [rank2]: File "/data2/yc/AgiBot-World/go1/internvl/model/go1/modeling_action_expert.py", line 513, in _init_weights
    [rank2]: std = self.config.initializer_range
    [rank2]: File "/home/hwuser/anaconda3/envs/go1/lib/python3.10/site-packages/transformers/configuration_utils.py", line 207, in getattribute
    [rank2]: return super().getattribute(key)
    [rank2]: AttributeError: 'GO1ModelConfig' object has no attribute 'initializer_range'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions