PyTransformer icon indicating copy to clipboard operation
PyTransformer copied to clipboard

AttributeError: 'tuple' object has no attribute 'clone'

Open sh7jacobi opened this issue 3 years ago • 1 comments

I run following script:

from PyTransformer.transformers.torchTransformer import TorchTransformer transformer = TorchTransformer() dot = transformer.visualize(self.model, input_tensor = batch['input'], save_name = "/datasets/fig2")

And I have "AttributeError: 'tuple' object has no attribute 'clone' ". But output of the model is not tuple, this is tensor. Can it work improperly if in forward proragation list is used?

sh7jacobi avatar Apr 29 '21 13:04 sh7jacobi

I have found error. Algorith work on improperly with function tensor.chunk becaus it returns tuple, not tensor. Could you correct the code?

sh7jacobi avatar Apr 29 '21 15:04 sh7jacobi