Error using DynamicSoftMarginLoss

Author: inakierregueabCreated Nov 12, 2024Updated Nov 15, 2024
Labelsbug

Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [128, 128, 1, 1]] is at version 4; expected version 2 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

Source: KevinMusgrave/pytorch-metric-learning