Hi, I am trying to implement mask R-CNN according to this tutorial TorchVision Object Detection Finetuning Tutorial — PyTorch Tutorials 1.7.1 documentation 4 I copied the code to my colab environment but it raises the following error when I execute the function main() :
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py”, line 198, in _worker_loop
data = fetcher.fetch(index)
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py”, line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py”, line 44, in 
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataset.py”, line 272, in getitem
return self.dataset[self.indices[idx]]
File “”, line 66, in getitem
img, target = self.transforms(img, target)
TypeError: call() takes 2 positional arguments but 3 were given
This issue :
  
    
    
    T.Compose | TypeError: __call__() takes 2 positional arguments but 3 were given vision
  
  
    I have been getting this odd error saying that I have passes too many arguments into my call() method. I am thoroughly perplexed because I am sure I have only passes 2 arguments. 
Here is my Compose class: 
class Compose(object):
    def __init__(self, transforms):
        self.transforms = transforms

    def __call__(self, image, target):
        for t in self.transforms:
            image, target = t(image, target)
        return image, target


Here’s the function that is call the method: 
d…
  


seems to be a similar error to mine, but I didnt create my own class for transforms, and I tried applying
To.Tensor() last and still gave me the same error.
any help is appreciated