Error in image classification

Code-https://ide.codingblocks.com/s/363426

Getting this error in Image classification project-
2020-10-27 09:42:00.616443: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library ‘cudart64_110.dll’; dlerror: cudart64_110.dll not found
2020-10-27 09:42:00.624199: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
…\Datasets\Images
<generator object Path.glob at 0x000001E4662D27C8>
(0,) (0,)
Traceback (most recent call last):
File “d:\data science\Project-5 Image Classification (SVM)\image_classification.py”, line 39, in
image_data[:],labels[:] = zip(*combined)
ValueError: not enough values to unpack (expected 2, got 0)
Exception ignored in: <function Buckets.del at 0x000001E45C54A730>
Traceback (most recent call last):
File “C:\Users\Aditya Srivastava\Anaconda3\lib\site-packages\tensorflow\python\eager\monitoring.py”, line 407, in del
AttributeError: ‘NoneType’ object has no attribute ‘TFE_MonitoringDeleteBuckets’

hey @pandeyaman461 ,
instead of keeping image_data[:],labels[:] = zip(*combined)
try converting to
image_data , labels = zip(*combined)

I hope it helps you :slightly_smiling_face:.

can you please share a drive link to data used in this code file.
I need to debug the code once , so would require to give it a test run.

Thank You

#Dataset Preparation

import numpy as np

import os

from pathlib import Path

from keras.preprocessing import image

import matplotlib.pyplot as plt

p = Path("…/…/dataset/")

print§

dirs = p.glob("*")

print(dirs)

labels_dict = {“cat”:0,“dog”:1,“horse”:2,“human”:3}

image_data = []

labels = []

for folder_dir in dirs:

#print(folder_name)

label = str(folder_dir).split("\\")[-1][:-1]

    

for img_path in folder_dir.glob("*.jpg"):

    img = image.load_img(img_path,target_size=(32,32))

    img_array = image.img_to_array(img)

    image_data.append(img_array)

    labels.append(labels_dict[label])

Convert this into numpy array

image_data = np.array(image_data,dtype=‘float32’)/255.0

labels = np.array(labels)

print(image_data.shape,labels.shape)

#Randomly Shuffle our Data!

import random

combined = list(zip(image_data,labels))

random.shuffle(combined)

#Unzip

image_data,labels = zip(*combined)

#Visualise this data!

from matplotlib import pyplot as plt

def drawImg(img):

plt.imshow(img)

plt.axis("off")

plt.show()    

return 

for i in range(10):

drawImg(image_data[i])

hey @pandeyaman461 ,
whenever you work on colab , use paths like /colab/dataset/… something.

never start it as …/…/ , its is working on linux. So that relativeness doesn’t work well.