Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in the brain_tumor_dataset_preparation.ipynb #4

Open
kruthikakr opened this issue Jun 18, 2021 · 1 comment
Open

Error in the brain_tumor_dataset_preparation.ipynb #4

kruthikakr opened this issue Jun 18, 2021 · 1 comment

Comments

@kruthikakr
Copy link


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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants