Closed cybermritunjay closed 3 years ago
Python3 list(self.frontend.state_dict().items())[i][1].data[:] = list(mod.state_dict().items())[i][1].data[:]
Python2 self.frontend.state_dict().items()[i][1].data[:] = mod.state_dict().items()[i][1].data[:]
xrange returns xrange object range returns range object there is a difference in them
Change xrange to range CSRNet code is Python2, you should change to code python 3
for i in range(len(self.frontend.state_dict().items())):
Traceback (most recent call last): File "F:\Bus-Tracking\person-counter\CSRNet-pytorch\val.py", line 64, in
model = CSRNet()
File "F:\CSRNet-pytorch\model.py", line 19, in init
self.frontend.state_dict().items()[i][1].data[:] = mod.state_dict().items()[i][1].data[:]
TypeError: 'odict_items' object is not subscriptable