'odict_items' object is not subscriptable how to deal with this?
In python3, items() returns a dict_keys object, you should try to convert it to a list:

list(self.frontend.state_dict().items())[i][1].data[:] =
list(mod.state_dict().items())[i][1].data[:]
I've tried to run this code on Jupyter notebook python 3:
class CSRNet(nn.Module):
    def __init__(self, load_weights=False):
        super(CSRNet, self).__init__()
        self.frontend_feat = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512]
        self.backend_feat  = [512, 512, 512,256,128,64]
        self.frontend = make_layers(self.frontend_feat)
        self.backend = make_layers(self.backend_feat,in_channels = 512,dilation = True)
        self.output_layer = nn.Conv2d(64, 1, kernel_size=1)
        if not load_weights:
            mod = models.vgg16(pretrained = True)
            self._initialize_weights()
            for i in range(len(self.frontend.state_dict().items())):
                self.frontend.state_dict().items()[i][1].data[:] = mod.state_dict().items()[i][1].data[:]
it displays 'odict_items' object is not subscriptable as an error in the last line of code!!how to deal with this?