Giter Club home page Giter Club logo

aksh-ai / neuralblack Goto Github PK

View Code? Open in Web Editor NEW
109.0 4.0 39.0 6.52 MB

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

License: Other

Jupyter Notebook 94.34% Python 2.39% CSS 1.72% HTML 1.56%
brain-tumor-classification brain-tumor-detection brain-tumor braintumour brain-tumour brain cnn pytorch classification accuracy torch cnn-classification resnet resnet-50 transfer-learning transferlearning deep-learning neural-networks

neuralblack's Issues

Error in the brain_tumor_dataset_preparation.ipynb


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

Question consultion

Dear authors:

 Recently I have read your project.  And I have the question, is that do the project have the  paper or tutorial? And how could I download the dataset? is this web: https://figshare.com/articles/dataset/brain_tumor_dataset/1512427  all datasets?

Undefined Variables in dataset preparation code

Hey, in the code for preparing the brain tumor dataset, there are a few corrections that I noticed:

  • undefined Variable border: In the loop where you are iterating over the files, you are appending to border without defining it earlier.
  • Coordinate (coord) Undefined: It seems like you are trying to append coord to borders, but coord is not defined in the loop.

Flask User Interface not redirecting to prediction layout

Hello, I'm a beginner in ML, I'm trying to execute your project for my study purpose and when I run the script deploy.py with powershell, the server execute and when I try to upload image and click on classify, it refreshes the page and is not showing the predicted layout.

This is what error says:
127.0.0.1 - - [05/Aug/2021 04:54:13] "POST /predict HTTP/1.1" 404 -
Exception

Expecting value: line 1 column 1 (char 0)

I thought there might be url problem as the class of predict.html is with def pred_page() so when I do change the url from:

with open(os.path.join(app.config['UPLOAD_FOLDER'], filename),'rb') as img:
predicted = requests.post("http://localhost:3000/predict", files={"file": img}).json()

to

with open(os.path.join(app.config['UPLOAD_FOLDER'], filename),'rb') as img:
predicted = requests.post("http://localhost:3000/pred_page", files={"file": img}).json()

it shows this error:
127.0.0.1 - - [05/Aug/2021 05:04:41] "POST /pred_page HTTP/1.1" 405 -
Exception

Expecting value: line 1 column 1 (char 0)

Can u help me out on this? There were some missing Import JSON line that I have added during debugging.

Thank You

Port Error

HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /predict (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002BC8ED71F40>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

OSError: [Errno 22] Invalid argument

When I run the training loop, I get the following error:

_---------------------------------------------------------------------------
OSError Traceback (most recent call last)
in ()
20
21 # train in batches
---> 22 for b, (y, X) in enumerate(train_gen):
23 # set label as cuda if device is cuda
24 X, y = X.to(device), y.to(device)

~\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py in iter(self)
499
500 def iter(self):
--> 501 return _DataLoaderIter(self)
502
503 def len(self):

~\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py in init(self, loader)
287 for w in self.workers:
288 w.daemon = True # ensure that the worker exits on process exit
--> 289 w.start()
290
291 _update_worker_pids(id(self), tuple(w.pid for w in self.workers))

~\Anaconda3\lib\multiprocessing\process.py in start(self)
103 'daemonic processes are not allowed to have children'
104 _cleanup()
--> 105 self._popen = self._Popen(self)
106 self._sentinel = self._popen.sentinel
107 # Avoid a refcycle if the target function holds an indirect

~\Anaconda3\lib\multiprocessing\context.py in _Popen(process_obj)
221 @staticmethod
222 def _Popen(process_obj):
--> 223 return _default_context.get_context().Process._Popen(process_obj)
224
225 class DefaultContext(BaseContext):

~\Anaconda3\lib\multiprocessing\context.py in _Popen(process_obj)
320 def _Popen(process_obj):
321 from .popen_spawn_win32 import Popen
--> 322 return Popen(process_obj)
323
324 class SpawnContext(BaseContext):

~\Anaconda3\lib\multiprocessing\popen_spawn_win32.py in init(self, process_obj)
63 try:
64 reduction.dump(prep_data, to_child)
---> 65 reduction.dump(process_obj, to_child)
66 finally:
67 set_spawning_popen(None)

~\Anaconda3\lib\multiprocessing\reduction.py in dump(obj, file, protocol)
58 def dump(obj, file, protocol=None):
59 '''Replacement for pickle.dump() using ForkingPickler.'''
---> 60 ForkingPickler(file, protocol).dump(obj)
61
62 #

OSError: [Errno 22] Invalid argument

I assumed it could be because of the large size of the pickle file so I changed the loading command to the code in this link:https://www.programmersought.com/article/3832726678/

but yet I am still getting the same error..

Is it possible to deply the model somewhere?

Hi there! I was following your project and it's really good. I was wondering if it's possible to deploy this model (.pt file) on Heroku or something so that I can make API calls to it and integrate this with an Android app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.