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 :
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.
Hmm that is wierd because I am running it with no problems. Could you try and run the colab version here to see if you get any errors. Also outside of the training loop can you do this
It seems that for this particular tutorial it is required to use the transforms script in references/detection/transforms.py from the pytorch repo rather than the torchvision.transforms module.
did you soulve the problem? I have the same problem, too. the code
import transforms as T
is correct in file tv-training-code.py.
but it still doesn’t work. do you have any idea? thx~~~