Thank you @ptrblck_de, the problem was just solved.
As I did not uninstall the previous version of torchvision when I upgrade to the latest version, the code was still using 2.0 instead of 2.1. The problem was solved when I simply deleted the old version.