PyTransformer
PyTransformer copied to clipboard
TypeError: object of type '_ReplaceFunc' has no len()
I have following error: if (len(logs) > 1) and (type(logs[0]) == torch.Tensor): TypeError: object of type '_ReplaceFunc' has no len() when I run: from PyTransformer.transformers.torchTransformer import TorchTransformer transformer = TorchTransformer() dot = transformer.visualize(self.base_layer, input_tensor = x.detach(), save_name = "/datasets/fig")
I have the same error for Sequential: nn.Sequential( nn.Conv2d(3, 6, kernel_size=7, stride=1, padding=3, bias=False), nn.BatchNorm2d(6, momentum=0.1), nn.ReLU(inplace=True)) I have removed Batch normalization layer and the error disappered. I guess it incorrectly process with some layers, particularly with BatchNorm layer.