Loading images in google colab

后端 未结 11 1844
梦如初夏
梦如初夏 2021-01-30 15:01

My Jupyter Notebook has the following code to upload an image to Colab:

from google.colab import files
uploaded = files.upload()

I get prompted

11条回答
  •  天涯浪人
    2021-01-30 15:43

    Am assuming you might not have written the file from memory?

    try the below code after the upload:

    with open("wash care labels", 'w') as f:
        f.write(uploaded[uploaded.keys()[0]])
    

    replace "wash care labels.xx" with your file name. This writes the file from memory. then try calling the file.

    Hope this works for you.

提交回复
热议问题