aksh-ai/neuralBlack

Error in the brain_tumor_dataset_preparation.ipynb

kruthikakr opened this issue · 1 comments


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

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