Cannot insert a Tensor that requires grad as a constant

The modules you’re adding have some Parameters, so they need to be submodules of CaffeNet. It should work if you use a torch.nn.Sequential instead of a regular Python list for self.layers.

3 Likes