train中出现NotImplementedError
Closed this issue · 6 comments
blackseven-white commented
训练中出现如下问题,疑似是尺度错误,但不知道是不是环境安装or torch版本的问题,
[0]
===> Start Epoch 1 End Epoch 501
===> Loading datasets
0%| | 0/1000 [00:00<?, ?img/s]
Traceback (most recent call last):
File "/home/Blackseven/src/ESDNet/train.py", line 169, in <module>
restored = model_restoration(input_)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/Blackseven/src/ESDNet/model.py", line 179, in forward
out_enc_level1 = self.encoder_level1(inp_enc_level1)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/container.py", line 217, in forward
input = module(input)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/Blackseven/src/ESDNet/model.py", line 78, in forward
out = self.residual(x) + self.shortcut(x)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/container.py", line 217, in forward
input = module(input)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/Blackseven/.local/lib/python3.10/site-packages/spikingjelly/activation_based/layer.py", line 1832, in forward
return functional.seq_to_ann_forward(x_seq, super().forward)
File "/home/Blackseven/.local/lib/python3.10/site-packages/spikingjelly/activation_based/functional.py", line 686, in seq_to_ann_forward
y = stateless_module(y)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/batchnorm.py", line 138, in forward
self._check_input_dim(input)
File "/anaconda3/lib/python3.10/site-packages/torch/nn/modules/batchnorm.py", line 83, in _check_input_dim
raise NotImplementedError
NotImplementedError
laofoye99 commented
我遇到了一样的问题,请问有解决么
blackseven-white commented
没有任何人回复我诶🤣还没解决 我怀疑可能是cuda版本问题 还没验证在 2024年9月4日,18:06,laofoye99 ***@***.***> 写道:
我遇到了一样的问题,请问有解决么
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
laofoye99 commented
I have already resolved the issue. The cause of the problem was this line in the model.py file:
layer.ThresholdDendentBatchNorm2d(num_features=dim, alpha=alpha, v_th=v_th, affine=True),
It was mentioned in 请教关于使用tdBN出现的问题 #542 and the solution can be found in 请问框架中的tdBN方法是还没有完成吗? #391, which requires cloning the Github repository SpikingJelly (version 0.0.0.0.15). However, the latest version available on PyPI is 0.0.0.0.14, which doesn't implement this function, resulting in the error. @MingTian99
jiabinYe commented
遇到了一摸一样的问题,请问怎么解决?
laofoye99 commented
你需要直接clone spikingjelly库,在python中安装的不是最新版的spikingjelly而是14版本的,最新版是15版本的,在上面链接的问题中有提到 @jiabinYe
blackseven-white commented
solution:手动安装spikingjelly-0.15:https://github.com/fangwei123456/spikingjelly