Unable to use .predict method with is_test=True (TypeError)

I downloaded a dataset from kaggle and practiced based on my understanding from first 3 lectures. I am getting accuracy over 93% but I am unable to predict. This might be a basic question but I searched the forums for answers and tried everything and still could not figure.

Attached my jupyter as a pdf file and I have train, valid and test1 folders. I have 2 jpg images in test1 folders and these are of random sizes.

Error Message: https://paste.ofcode.org/33Ar8EgqK9emHjE6T57zCwC

sasank_flowers_kaggle.pdf (99.2 KB)

Solved. I initialized data variable multiple times but added path only on first initialization.