AttributeError: 'NoneType' object has no attribute 'crop'

I am getting this error while trying to deploy computer vision models that I built using fastai library. Can anyone tell me how I can fix this error ? I have attached the code and the error screenshot below: