how to get rid of exception class: NoneType?

65 Views Asked by At
# Read in the image
from google.colab import drive
drive.mount('/gdrive')
filepath='gdrive/MyDrive/image.png'
image = cv2.imread(filepath)
print(type(image))

While running this i am getting Class "NoneType" . Where i am failing in reading image file from drive. please correct me.

1

There are 1 best solutions below

0
On

I think the image path should be an absolute path with a slash in the beginning. ('/gdrive/MyDrive/image.png').