ChiWeiHsiao / DeepVO-pytorch

PyTorch Implementation of DeepVO
347 stars 105 forks source link

KeyError:'eps' #55

Open mono0826 opened 7 months ago

mono0826 commented 7 months ago

File "/usr/local/lib/python3.8/dist-packages/torch/optim/adagrad.py", line 128, in step eps=group["eps"], KeyError: 'eps'

Hello, I got this error when I was running, how can I solve it?

hu-xue commented 6 months ago

hello, I got this too, Have you solve it? Can you share the fix functions with me? best wishes!

yutianhe12345 commented 5 months ago

优化器的 eps 参数是一个很小的数值,用于防止除零错误和数值不稳定性。在计算梯度下降步骤中,有时候可能会涉及到除以一个很小的数或者对一个很小的数进行开方操作,而这些操作可能导致数值不稳定或者无法进行。为了避免这种情况,eps 参数会被加到分母中,以确保分母不为零。 加载作者的优化器参数时,这个键eps的值缺失,所以我们可以在加载优化器后声明它的值,代码如下: optimizer.param_groups[0]['eps'] = 1e-8 image