shubz_308:

TypeError: img should be PIL Image. Got <class 'dict'>


This error message is thrown from transforms. It is clear enough. No?
It seems you are passing a python dict to the transform instead of the PIL image.