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
I was trying to run the coco dataset training example and I came across the issue of
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 pycocotoolsotherwise, add pycocotools to the requirements.txt