Bro im getting this error in def get data: ValueError: setting an array element with a sequence. The requested array has an inhomogeneos shape after 2 dimensions. Please help me with the solution
import os add this code: def supprimer_ds_store(directory): for root, dirs, files in os.walk(directory): for file in files: if file.endswith('.DS_Store'): os.remove(os.path.join(root, file)) # Utilisation de la fonction pour supprimer les fichiers .DS_Store dans un dossier spécifié supprimer_ds_store('/content/chest_xray/chest_xray/train') supprimer_ds_store('/content/chest_xray/chest_xray/test') supprimer_ds_store('/content/chest_xray/chest_xray/val') and change the other code with this : labels = ['PNEUMONIA','NORMAL'] img_size = 128 def get_data(data_dir): data = [] for label in labels: path = os.path.join(data_dir, label) class_num = labels.index(label) for img_name in os.listdir(path): img_path = os.path.join(path, img_name) img_arr = cv2.imread(img_path, cv2.IMREAD_GRAYSCALE) if img_arr is not None: # Vérifier si l'image a été chargée correctement try: resized_arr = cv2.resize(img_arr, (img_size, img_size)) data.append([resized_arr, class_num]) except Exception as e: print(f"Error resizing image {img_path}: {e}") else: print(f"Failed to load image {img_path}") return np.array(data, dtype=object)
Devin AI is not so dangerous that's we think, main things is that's we lose our confidence on software development. It's hard to build one complete architecture with AI, otherwise language teacher losing there job right after google translate come into the picture, but It's can't!
please make a video on """cardiovascular disease prediction using optimal feature selection using images of healthy heart and diseased heart"""
Noted
superb 😍😍
Thank you! Cheers!
Bro im getting this error in def get data:
ValueError: setting an array element with a sequence. The requested array has an inhomogeneos shape after 2 dimensions.
Please help me with the solution
same
import os
add this code:
def supprimer_ds_store(directory):
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('.DS_Store'):
os.remove(os.path.join(root, file))
# Utilisation de la fonction pour supprimer les fichiers .DS_Store dans un dossier spécifié
supprimer_ds_store('/content/chest_xray/chest_xray/train')
supprimer_ds_store('/content/chest_xray/chest_xray/test')
supprimer_ds_store('/content/chest_xray/chest_xray/val')
and change the other code with this :
labels = ['PNEUMONIA','NORMAL']
img_size = 128
def get_data(data_dir):
data = []
for label in labels:
path = os.path.join(data_dir, label)
class_num = labels.index(label)
for img_name in os.listdir(path):
img_path = os.path.join(path, img_name)
img_arr = cv2.imread(img_path, cv2.IMREAD_GRAYSCALE)
if img_arr is not None: # Vérifier si l'image a été chargée correctement
try:
resized_arr = cv2.resize(img_arr, (img_size, img_size))
data.append([resized_arr, class_num])
except Exception as e:
print(f"Error resizing image {img_path}: {e}")
else:
print(f"Failed to load image {img_path}")
return np.array(data, dtype=object)
Bro can u upload the model in the github urgent
where did you get the dataset?
kaggle
bro please put the video of "" ADVANCED PROJECT HEART DISEASE PREDICTION USING ML"
Noted
Sir 😢 please Convert in .exe file please
Noted
@@knowledgedoctor3849 ?
bro devin is enter this chat
Devin AI is not so dangerous that's we think, main things is that's we lose our confidence on software development.
It's hard to build one complete architecture with AI, otherwise language teacher losing there job right after google translate come into the picture, but It's can't!
sir please do the video on heart disease prediction using deep learning advanced project deployed on website
Noted