-1

I try to load python image in google colab environment. But it's failed due to

FileNotFoundError: [Errno 2] No such file or directory: '/content/gdrive/My Drive/path_to_image/img.jpg'

I already uploaded image into google drive. how to fix this issue?

enter image description here

James Z
  • 12,209
  • 10
  • 24
  • 44
  • Welcome back to Stack Overflow - it has been a long time. As a refresher, please read [ask], and [do not upload images of code or errors when asking a question.](//meta.stackoverflow.com/q/285551) Instead, copy and paste the relevant code as [properly formatted](https://stackoverflow.com/help/formatting) text. Show a [complete](https://meta.stackoverflow.com/questions/359146) error by copying and pasting, starting from the line that says `Traceback (most recent call last):`, and formatting it like code. We [will not transcribe](https://meta.stackoverflow.com/questions/415040) images for you. – Karl Knechtel Jul 03 '22 at 16:20

2 Answers2

0

try to past the exact file location:

image = img.imread("D:\\Something\Something\img.jpg")
0

I found solution. Step one : mount google drive to colab project as below enter image description here

Step two: copy image path to relevant location. see below enter image description here

Problem solved

  • The same advice for images applies to answers. If there is something you need to highlight in the Google Colab UI, then that can use an image, but also use text to explain what to do - don't just circle a button; say to click there, and explain what will happen next. If you need to talk about a change to the code, show the changed code. – Karl Knechtel Jul 03 '22 at 16:23