BEbillionaireUSD/Hades

Having trouble with agn-hades

Opened this issue · 4 comments

Hi authors,

Thanks for your detailed codebase. However, I encounter the following error when I run

python codes/run.py --main_model agn-hades --data ../data/chunk_10

Error:

Traceback (most recent call last):
  File "/root/autodl-tmp/Hades/hades/codes/run.py", line 129, in <module>
    main([4,3,2,2])
  File "/root/autodl-tmp/Hades/hades/codes/run.py", line 113, in main
    model = BaseModel(device=device, var_nums=var_nums, vocab_size=vocab_size, **params)
  File "/root/autodl-tmp/Hades/hades/codes/models/base.py", line 43, in __init__
    self.model = MultiModel(var_nums=var_nums, vocab_size=vocab_size, device=device, **kwargs)
  File "/root/autodl-tmp/Hades/hades/codes/models/fuse.py", line 102, in __init__
    self.encoder = MultiEncoder(var_nums=var_nums, device=device, fuse_type=fuse_type, **kwargs)
  File "/root/autodl-tmp/Hades/hades/codes/models/fuse.py", line 54, in __init__
    self.kpi_encoder = KpiEncoder(var_nums, device, **kwargs) 
  File "/root/autodl-tmp/Hades/hades/codes/models/kpi_model.py", line 88, in __init__
    self.t_encoders = [TemporalEncoder(device, **kwargs) for _ in range(self.metric_num)]
  File "/root/autodl-tmp/Hades/hades/codes/models/kpi_model.py", line 88, in <listcomp>
    self.t_encoders = [TemporalEncoder(device, **kwargs) for _ in range(self.metric_num)]
TypeError: __init__() missing 1 required positional argument: 'input_size'

Could you kindly check what's going wrong? Appreciated!

It might be a typo. I've updated TemporalEncoder(device, 1, **kwargs) <-TemporalEncoder(device, **kwargs). It should be fine now.

Yes, it does. Thanks for the quick update!

Hi authors,

After changing according to your suggestions, the code is able to run Phase I training. However, the following error is generated when running Phase II. Could you kindly check? Thanks!

2024-03-12 23:29:40,530 P6057 INFO *** Test F1 0.8437  of traning phase 1
Traceback (most recent call last):
  File "/root/autodl-tmp/Hades/hades/codes/run.py", line 129, in <module>
    main([4,3,2,2])
  File "/root/autodl-tmp/Hades/hades/codes/run.py", line 119, in main
    scores = model.fit(train_loader, unlabel_loader, test_loader)
  File "/root/autodl-tmp/Hades/hades/codes/models/base.py", line 191, in fit
    pseudo_data = self.inference(unlabel_loader)
  File "/root/autodl-tmp/Hades/hades/codes/models/base.py", line 76, in inference
    result = self.model.forward(self.__input2device(_input), flag=True)
  File "/root/autodl-tmp/Hades/hades/codes/models/fuse.py", line 117, in forward
    fused_re, (kpi_re, log_re) = self.encoder(input_dict["kpi_features"], input_dict["log_features"]) 
  File "/root/miniconda3/envs/Hades/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/root/miniconda3/envs/Hades/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/root/autodl-tmp/Hades/hades/codes/models/fuse.py", line 65, in forward
    kpi_re = self.kpi_encoder(kpi_x) #[batch_size, T, hidden_size]
  File "/root/miniconda3/envs/Hades/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/root/miniconda3/envs/Hades/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/root/autodl-tmp/Hades/hades/codes/models/kpi_model.py", line 116, in forward
    inner_input = encoded_metric.permute(1, 2, 0) #--> [batch_size, T, metric_num]
RuntimeError: permute(sparse_coo): number of dimensions in the tensor input does not match the length of the desired ordering of dimensions i.e. input.dim() = 2 is not equal to len(dims) = 3

Could you please add some printing statements so that I can further diagnose the issue?
Like the size of input_dict["kpi_features"], the size of input_dict["log_features"], the size of kpi_re