genrec icon indicating copy to clipboard operation
genrec copied to clipboard

Unable to run TIGER training on Amazon 2014

Open RoydonTay opened this issue 7 months ago • 4 comments

Hi!

In genrec/config/tiger/amazon/tiger.gin, the import genrec.models.tiger_new does not exist. When I modified the .gin file to use the tiger.py model instead, I noticed the config parameters are different from what tiger_trainer.py expects too. There seems to be a big mismatch between the train method arguments and .gin config.

May I check if the repository is missing the most updated version of the TIGER model or .gin config? Thanks!

RoydonTay avatar Apr 30 '26 02:04 RoydonTay

@RoydonTay sorry for the slow reply on this. Just pushed a fix in 93f2f4a — please git pull and try again. Thanks for the report!

phonism avatar May 06 '26 06:05 phonism

Thank you for your response, I am still facing the issue of missing arguments in the amazon/tiger.gin for Amazon 2014, where the gin config is outdated. Is the current tiger_trainer.py only compaitble with amazon2023/tiger.gin?

Here is the error I encounter when running: python genrec/trainers/tiger_trainer.py config/tiger/amazon/tiger.gin --split beauty

Traceback (most recent call last):
  File "/home/work/chatbot-llms-3/roydon.tay/test/genrec/genrec/trainers/tiger_trainer.py", line 334, in <module>
    train()
  File "/usr/local/lib/python3.10/dist-packages/gin/config.py", line 1605, in gin_wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "/usr/local/lib/python3.10/dist-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
    raise proxy.with_traceback(exception.__traceback__) from None
  File "/usr/local/lib/python3.10/dist-packages/gin/config.py", line 1582, in gin_wrapper
    return fn(*new_args, **new_kwargs)
  File "/home/work/chatbot-llms-3/roydon.tay/test/genrec/genrec/trainers/tiger_trainer.py", line 200, in train
    model = Tiger(model_config).to(device)
TypeError: Tiger.__init__() missing 7 required positional arguments: 'attn_dim', 'dropout', 'num_heads', 'n_layers', 'num_item_embeddings', 'num_user_embeddings', and 'sem_id_dim'
  In call to configurable 'train' (<function train at 0x7efb10462a70>)

RoydonTay avatar May 06 '26 07:05 RoydonTay

@RoydonTay Hi, this looks like the fix didn't reach your checkout. The error says Tiger.init() requires attn_dim, dropout, n_layers, num_item_embeddings, ... — that's the old tiger.py signature. The new one (commit 93f2f4a) takes a single config dict. https://github.com/phonism/genrec/blob/main/genrec/models/tiger.py#L20

phonism avatar May 06 '26 07:05 phonism

Hi, you are right it was some mistake on my end. Your fix solved the problem. Thank you so much!

RoydonTay avatar May 06 '26 08:05 RoydonTay