'ImageImageList' object has no attribute 'apply_tfms'

I used fastai in kaggle’s image classification competition, and there was no problem in the training process, but there was an error in the prediction.
If I used get_preds(), I could predict the result of test dataset added in the data block, but if I wanted to directly predict(), I would report the following error:

train_df=pd.read_csv(data_dir/‘train.csv’)
test_df=pd.read_csv(data_dir/‘sample_submission.csv’)
test_images=ImageList.from_df(test_df,path=data_dir,folder=‘test’)
tfms=get_transforms()
train_img=(ImageList.from_df(train_df, path=data_dir, folder=‘train’)
.split_by_rand_pct(0.01)
.label_from_df()
.add_test(test_images)
.transform(tfms, size=128)
.databunch(bs=8)
.normalize(imagenet_stats))

learn=cnn_learner(train_img,models.resnet50,metrics=[error_rate,accuracy])
learn.fit_one_cycle(10)
preds,_=learn.get_preds(ds_type=DatasetType.Test)

preds,_=learn.predict(test_images)

print(preds.shape)

if I use predict(test_images):