pytorch使用pytorch_wavelets包错误:ValueError: step must be greater than zero 错误解决

错误描述

在使用pytorch_wavelets包的DWT1DInverse时,发现报错信息如下:
Traceback (most recent call last):
File "/work/GDN/test/test_DWT.py", line 24, in
x_ = idwt((YL, YH))
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/opt/conda/lib/python3.6/site-packages/pytorch_wavelets/dwt/transform1d.py", line 107, in forward
for x1 in highs[::-1]:
ValueError: step must be greater than zero

原因排查

查看包原码,发现有可能是tensor和np切片不同造成的保存,遂使用numpy转换之后再进入idwt
之后依然报错,查询github相应issue 发现是输入格式问题
正确格式:
test_ground= idwt((test_ground_l, [test_ground_h]))
错误格式:
test_ground= idwt((test_ground_l, test_ground_h))

参考文献

https://github.com/fbcotter/pytorch_wavelets/issues/43

posted @   David_Dong  阅读(475)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
点击右上角即可分享
微信分享提示