Jyonn / Legommenders

A modular recommendation system that allows the selection of different components to be combined into a new recommender.
MIT License
10 stars 1 forks source link

Cannot run LSTUR model #3

Closed chiyuzhang94 closed 7 months ago

chiyuzhang94 commented 7 months ago

I found that the running of LSTUR model gets errors. It seems the missing of num_columns in configurations.

Could you take a look at this issue?

Traceback (most recent call last):
  File "/opt/hpcaas/.mounts/fs-5c62ddab/home/chiyu/Legommenders/worker.py", line 488, in <module>
    worker.run()
  File "/opt/hpcaas/.mounts/fs-5c62ddab/home/chiyu/Legommenders/worker.py", line 441, in run
    epoch = self.train_runner()
  File "/opt/hpcaas/.mounts/fs-5c62ddab/home/chiyu/Legommenders/worker.py", line 384, in train_runner
    return self.train()
  File "/opt/hpcaas/.mounts/fs-5c62ddab/home/chiyu/Legommenders/worker.py", line 169, in train
    loss = self.legommender(batch=batch)
  File "/data/home/chiyu/miniconda3/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/data/home/chiyu/miniconda3/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/hpcaas/.mounts/fs-5c62ddab/home/chiyu/Legommenders/model/legommender.py", line 206, in forward
    item_embeddings = self.get_item_content(batch, self.candidate_col)
  File "/opt/hpcaas/.mounts/fs-5c62ddab/home/chiyu/Legommenders/model/legommender.py", line 166, in get_item_content
    item_contents = self.item_encoder.get_full_item_placeholder(sample_size).to(Meta.device)
  File "/opt/hpcaas/.mounts/fs-5c62ddab/home/chiyu/Legommenders/model/operators/cnn_cat_operator.py", line 37, in get_full_item_placeholder
    return torch.zeros(sample_size, self.config.hidden_size * self.num_columns)
  File "/data/home/chiyu/miniconda3/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1695, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'CNNCatOperator' object has no attribute 'num_columns'
Jyonn commented 7 months ago

Sorry, there is a update of the legommender framework that not considered the compatibility of the LSTUR. This issue will not be quickly solved until the next major update of the framework.

chiyuzhang94 commented 7 months ago

Ok. Got it. Thanks.