Help with the Error: Path('xyz1234') and Path("xyz1234") are the same file

I just used copy and edit on “Is it a bird? Creating a model from your own data” on Kaggle. Wanted to create a Cheetah vs Leopard Classifier.Just changed the code for searching from bird to cheetah and forest to leopard. But getting an error while saving each group to a different folder. Rest all Code are same.
Error Says:
Path(‘cheetah_or_not/cheetah/8f88d1e2-1e91-4c8b-a88b-18dc83b1389f.jpg’) and Path(‘cheetah_or_not/cheetah/8f88d1e2-1e91-4c8b-a88b-18dc83b1389f.jpg’) are the same file

Please help me out.

Provided Screenshots of the code and Error Below:



Thanks in Advance. :smile:

hi adinarendra,
Just to conserve the time of those that are willing to help out, could you let use know which searches you already tried that didn’t work out. e.g. fastai path “are the same file”

If you’re lazy like me, just delete using

import shutil

and run the cell away

Reducing the number of max_size=400 to max_size=300, solved the problem for me.

1 Like

Yeah. I will the next time.
Thanks for the help.

Thanks, @wyquek, and @hsaldera for helping out