In colab, the file paths don't have "\\", so in my case it is working now by replacing this line: fn = str(file).split('/')[-2], and ull = str(u).split('/')[-2] Kindly, update me about this. Thanks..