Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dt1729 opened this issue Mar 29, 2023 · 0 comments
Open

Comments

@dt1729
Copy link

dt1729 commented Mar 29, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant