Problem with downloading bear images from url-file

When I run the following command:
download_images(‘drive\My Drive\Colab Notebooks\bears\teddys\urls_teddy.csv’, dest, max_pics=10, max_workers=0)
I get the error:
File “<ipython-input-24-812035371ece>”, line 1 download_images(‘drive\My Drive\Colab Notebooks\bears\teddys\urls_teddy.csv’, dest, max_pics=10, max_workers=0) ^
SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 43-44: truncated \uXXXX escape

I have kept only 10 records in the url-file. And there is no \u escape-sequence. I am using chrome (however, in Firefox also similar problem is coming up). Has anyone faced and solved this issue?

Screenshot:

Solved it on my own. Needed to put a ‘r’ in front of the file-path string and forward-slashes like:
download_images(r"drive/My Drive/Colab Notebooks/bears/black/urls_black.csv", dest, max_pics=10, max_workers=0) .

1 Like