aksh-ai / neuralBlack

A Multi-Class Brain Tumor Classifier using Convolutional Neural Network with 99% Accuracy achieved by applying the method of Transfer Learning using Python and Pytorch Deep Learning Framework
Other
125 stars 44 forks source link

Error in the brain_tumor_dataset_preparation.ipynb #4

Open kruthikakr opened 3 years ago

kruthikakr commented 3 years ago

IndexError Traceback (most recent call last)

in () 3 img = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB) 4 img = cv2.resize(img, (512, 512)) ----> 5 label = y[i-1] 6 training_data.append([img, label]) 7 IndexError: list index out of range
janhavipatil9 commented 2 years ago

filename = None

for filename in range(1, 3065): with h5py.File('/content/drive/My Drive/Colab Notebooks/dataset/imageData/{}.mat'.format(filename), 'r') as f: img = f['cjdata']['image'] label = f['cjdata']['label'][0][0]

  labels.append(int(label))

  border.append('coord')
  img = np.array(img, dtype=np.float32)

  plt.axis('off')
  plt.imsave("/content/drive/My Drive/Colab Notebooks/new_dataset/bt_images/{}.jpg".format(filename), img, cmap='gray')

print("{} files successfully saved".format(filename))

NameError Traceback (most recent call last) in 9 labels.append(int(label)) 10 ---> 11 border.append('coord') 12 img = np.array(img, dtype=np.float32) 13

NameError: name 'border' is not defined