Skip to content

Error: "root:NaN or Inf found in input tensor." #12

@CZ-CHO

Description

@CZ-CHO

Hello, Wei. When I run your network (also using your data), I always get a warning "root:NaN or Inf found in input tensor." in a fixed position (in train data 3293), and then the value of loss becomes "nan". Have you ever encountered such a situation? Or do you know what causes this? Some people said that the learning rate may be too high and there may be a gradient explosion. But after I reduce the learning rate (even set it to 0), I will still make mistakes in the same position. The pytorch version I use is 1.7.0 instead of 0.4.0 you use. I wonder if this is the reason?
Looking forward to your reply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions