Skip to content

Bugs in Gradient Checker #6814

@hzxie

Description

@hzxie

Issue summary

The estimated gradients by GradientChecker are not correct. I implemented my own Caffe layer and the gradients are the same as PyTorch and JAX. But GradientChecker tells me that my gradient are not correct.

Steps to reproduce

  1. Create the Chamfer Distance Loss Layer. The code is attached below. For convenient, I only provide the code for CPU.
  2. Create the unit test for the Chamfer Distance Loss Layer.
  3. Rebuild Caffe with make -j8
  4. make runtest GTEST_FILTER='Chamfer*' -j8

Tried solutions

Compare my gradients with autograd and PyTorch. And they are the same.

System configuration

  • Operating system: Arch Linux
  • Compiler: gcc (GCC) 9.1.0
  • CUDA version (if applicable): 10.0.130
  • CUDNN version (if applicable): 7.6.1.34-1
  • BLAS: OpenBLAS
  • Python version (if using pycaffe): 3.7.4
  • MATLAB version (if using matcaffe): N/a

Issue checklist

  • read the guidelines and removed the first paragraph
  • written a short summary and detailed steps to reproduce
  • explained how solutions to related problems failed (tick if found none)
  • filled system configuration
  • attached relevant logs/config files (tick if not applicable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions