PFST-LSTM icon indicating copy to clipboard operation
PFST-LSTM copied to clipboard

Error: TypeError: 'int' object is not callable

Open Chengwen-98 opened this issue 2 years ago • 2 comments

When I run the code with your env and datasets,i get this:

Traceback (most recent call last):
  File "/home/dell/下载/PSTF_LSTM/experiment/CIKM/dec_PFST_ConvLSTM.py", line 453, in <module>
    model.train()
  File "/home/dell/下载/PSTF_LSTM/experiment/CIKM/dec_PFST_ConvLSTM.py", line 79, in train
    output = self.encoder_decoder_model(in_frame_dat)
  File "/home/dell/anaconda3/envs/py37/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/dell/下载/PSTF_LSTM/model/PFSTEncodeDecode.py", line 710, in forward
    encode_states, M = self.models[0](input)
  File "/home/dell/anaconda3/envs/py37/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/dell/下载/PSTF_LSTM/model/PFSTEncodeDecode.py", line 399, in forward
    self.n_step = input.size()[1]
TypeError: 'int' object is not callable

As far as I know,the class of the input in the PFSTEncodeDecode.py 's forward func is <class 'numpy.ndarray'>. Why is there .size() here? This location is not working properly.

Chengwen-98 avatar Sep 20 '22 14:09 Chengwen-98