Skip to content

how to add adaptive_max_pool2d_backward_cuda does not have a deterministic implementation, but you set 'torch.use_deterministic_algorithms(True)' #87029

@akashAD98

Description

@akashAD98

🐛 Describe the bug

i have added attention mechanism to yolov5 repo, while doing the training I'm getting this issue , how can I solve this error?

error

i tried to train model using yolov5 command ,& i used C3CBAM attention mechanism , & I'm getting this error

!python train.py --img 640 --batch 16 --cfg /content/yolov5/models/yolov5s.yaml --epochs 250 --data coco128.yaml --weights yolov5s.pt --cache

image

Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/8 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "train.py", line 637, in <module>
    main(opt)
  File "train.py", line 531, in main
    train(opt.hyp, opt, device, callbacks)
  File "train.py", line 320, in train
    scaler.scale(loss).backward()
  File "/usr/local/lib/python3.7/dist-packages/torch/_tensor.py", line 396, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
  File "/usr/local/lib/python3.7/dist-packages/torch/autograd/__init__.py", line 175, in backward
    allow_unreachable=True, accumulate_grad=True)  # Calls into the C++ engine to run the backward pass
RuntimeError: adaptive_max_pool2d_backward_cuda does not have a deterministic implementation, but you set 'torch.use_deterministic_algorithms(True)'. You can turn off determinism just for this operation, or you can use the 'warn_only=True' option, if that's acceptable for your application. You can also file an issue at https://github.com/pytorch/pytorch/issues to help us prioritize adding deterministic support for this operation.
```

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