wanghq21 / MICN

Code release of paper "MICN: Multi-scale Local and Global Context Modeling for Long-term Series Forecasting" (ICLR 2023)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

代码错误咨询

Jinshui-wang opened this issue · comments

请问这个文章代码中我总是报以下错误,该如何解决?

Traceback (most recent call last):

File "D:/ProgramData/JetBrains/PyCharm Community Edition 2023.2.1/plugins/python-ce/helpers/pydev/pydevd.py", line 1500, in _exec

pydev_imports.execfile(file, globals, locals) # execute the script

File "D:\ProgramData\JetBrains\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile

exec(compile(contents+"\n", file, 'exec'), glob, loc)

File "F:\MICN\MICN-main\MICN-main[run.py](http://link.zhihu.com/?target=http%3A//run.py)", line 122, in

exp.train(setting)

File "F:\MICN\MICN-main\MICN-main\exp\exp_informer.py", line 165, in train

pred, true = self._process_one_batch(

File "F:\MICN\MICN-main\MICN-main\exp\exp_informer.py", line 317, in _process_one_batch

outputs = self.model(batch_x, batch_x_mark, dec_inp, batch_y_mark)

File "D:\ProgramData\anaconda3\envs\py38\lib\site-packages\torch\nn\modules[module.py](http://link.zhihu.com/?target=http%3A//module.py)", line 1518, in _wrapped_call_impl

return self._call_impl(*args, **kwargs)

File "D:\ProgramData\anaconda3\envs\py38\lib\site-packages\torch\nn\modules[module.py](http://link.zhihu.com/?target=http%3A//module.py)", line 1527, in _call_impl

return forward_call(*args, **kwargs)

File "F:\MICN\MICN-main\MICN-main\models[model.py](http://link.zhihu.com/?target=http%3A//model.py)", line 48, in forward

dec_out = self.dec_embedding(seasonal_init_dec, x_mark_dec)

File "D:\ProgramData\anaconda3\envs\py38\lib\site-packages\torch\nn\modules[module.py](http://link.zhihu.com/?target=http%3A//module.py)", line 1518, in _wrapped_call_impl

return self._call_impl(*args, **kwargs)

File "D:\ProgramData\anaconda3\envs\py38\lib\site-packages\torch\nn\modules[module.py](http://link.zhihu.com/?target=http%3A//module.py)", line 1527, in _call_impl

return forward_call(*args, **kwargs)

File "F:\MICN\MICN-main\MICN-main\models[embed.py](http://link.zhihu.com/?target=http%3A//embed.py)", line 109, in forward

x = self.value_embedding(x) + self.position_embedding(x) + self.temporal_embedding(x_mark)

RuntimeError: The size of tensor a (120) must match the size of tensor b (72) at non-singleton dimension 1

这个是参数没调对,作者的micn.sh文件有对应的参数,能调用就调用,调用不了就把run里的True改为False成默认模式,然后对着sh文件改参数
image
image