I have a model which loads fine in C++, ( and works in Python ), but when I call ‘forward’ in C++ it fails with (unhandled) torch::jit::constant_not_supported_error exceptions from insertConstant.The model consists of convolutions followed by transposed convolutions. I’m working on visual studio 2017.
A simple network causing the problem:
self.common_part = nn.Sequential(
nn.Conv2d(1, 128, 5, 2,padding = 2),
nn.ConvTranspose2d(128, 1, 5, 2,padding = 2, output_padding = 1),
n = self.common_part(x)
Any help would be appreciated.