behavior
cloning
gaming
agent

Encounter a Traceback server when I run the inference server locally: AttributeError: 'SiglipConfig' object has no attribute 'hidden_size'

#4
by wkruan - opened

Hi I try to run the model locally in my computer. But when I run python scripts/serve.py "C:....cache\huggingface\hub\models--nvidia--NitroGen\snapshots\df04e6f6c84548bcbc66824c99d8895f151af23c\ng.pt" command.

It failed and report a Traceback error. Can anyone help me?

Traceback (most recent call last):
File "F:\CursorProjects\NitroGen\scripts\serve.py", line 16, in
session = InferenceSession.from_ckpt(args.ckpt, old_layout=args.old_layout, cfg_scale=args.cfg, context_length=args.ctx)
File "F:\CursorProjects\NitroGen\nitrogen\inference_session.py", line 125, in from_ckpt
model, tokenizer, img_proc, ckpt_config, game_mapping, action_downsample_ratio = load_model(checkpoint_path)
~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "F:\CursorProjects\NitroGen\nitrogen\inference_session.py", line 66, in load_model
model = NitroGen(config=model_cfg, game_mapping=game_mapping)
File "F:\CursorProjects\NitroGen\nitrogen\flow_matching_transformer\nitrogen.py", line 185, in init
model = SiglipVisionModel.from_pretrained(config.vision_encoder_name)
File "C:\Users\ruanweikang\AppData\Roaming\Python\Python314\site-packages\transformers\modeling_utils.py", line 277, in _wrapper
return func(*args, **kwargs)
File "C:\Users\ruanweikang\AppData\Roaming\Python\Python314\site-packages\transformers\modeling_utils.py", line 4971, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
File "C:\Users\ruanweikang\AppData\Roaming\Python\Python314\site-packages\transformers\models\siglip\modeling_siglip.py", line 752, in init
self.vision_model = SiglipVisionTransformer(config)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "C:\Users\ruanweikang\AppData\Roaming\Python\Python314\site-packages\transformers\models\siglip\modeling_siglip.py", line 682, in init
embed_dim = config.hidden_size
^^^^^^^^^^^^^^^^^^
File "C:\Users\ruanweikang\AppData\Roaming\Python\Python314\site-packages\transformers\configuration_utils.py", line 207, in getattribute
return super().getattribute(key)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
AttributeError: 'SiglipConfig' object has no attribute 'hidden_size'

I asked Cursor with Sonnet. And it said my Tranformers (4.57.3) model may be too new, and recommand me to install the older transformers (4.44.0)

But I think it shouldn't be the reason, right?

downgrading to transformers==4.44.0 and python 3.12 worked for me

downgrading to transformers==4.44.0 and python 3.12 worked for me

Thank you. I didnt downgrade the transformers version. But it works after I use Python 3.12 in conda

Sign up or log in to comment