Skip to content

Training breaks with Pytorch version 1.13.0 and torchvision version 0.8.0 #15

Description

@dt1729

I was trying to run the coco dataset training example and I came across the issue of

  File "test.py", line 126, in <module>
    prefetch_test(opt)
  File "test.py", line 58, in prefetch_test
    detector.model.v2_transform()
  File "/home/dt/DetectionNN/CenterNet-HarDNet/src/lib/models/networks/hardnet.py", line 494, in v2_transform
    self.base[i].transform(blk, self.trt)
  File "/home/dt/DetectionNN/CenterNet-HarDNet/src/lib/models/networks/hardnet.py", line 227, in transform
    self.conv_layers[i].weight[0:part[0], :, :,:] = w_src[:, 0:in_ch, :,:]
RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.

both w_src and weight are leaf variables and pytorch doesn't allow the same. Go through this and this for more detail.

A temporary solution is virtual env with pytorch version 1.7.0 and torchvision version 0.8.1 works with that.

Sourcing pycocotools can be difficult so this line can help in the virtual environment:

pip3 install pycocotools

otherwise, add pycocotools to the requirements.txt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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