Pradip-p / E-Health-Care

The web app which is used to remove the dependencies on the doctors, to help out the poor and helpless people with the normal medical checkup and to help people avoid paying huge amount to doctor unnecessarily. This project is made with Django, machine learning algorithms and deep learning (ANN and CNN).
https://pradip-p.github.io/E-Health-Care
MIT License
22 stars 13 forks source link

Exception Type: ValueError at /patient/diabetes/ Exception Value: node array from the pickle has an incompatible dtype: - expected: {'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', 'n_node_samples', 'weighted_n_node_samples', 'missing_go_to_left'], 'formats': ['<i8', '<i8', '<i8', '<f8', '<f8', '<i8', '<f8', 'u1'], 'offsets': [0, 8, 16, 24, 32, 40, 48, 56], 'itemsize': 64} - got : [('left_child', '<i8'), ('right_child', '<i8'), ('feature', '<i8'), ('threshold', '<f8'), ('impurity', '<f8'), ('n_node_samples', '<i8'), ('weighted_n_node_samples', '<f8')] #33

Open jeremymikindi opened 1 month ago

jeremymikindi commented 1 month ago

When testing modules, for example diabete

issue

The below error is occuring

`Environment:

Request Method: POST Request URL: http://127.0.0.1:8000/patient/diabetes/

Django Version: 2.2.28 Python Version: 3.10.12 Installed Applications: ['widget_tweaks', 'rest_framework', 'chat', 'appointment', 'patient', 'doctor', 'Health', 'roleadmin', 'crispy_forms', 'api', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'chat.middleware.ActiveUserMiddleware']

Traceback:

File "/home/jeremie/.local/lib/python3.10/site-packages/django/core/handlers/exception.py" in inner

  1. response = get_response(request)

File "/home/jeremie/.local/lib/python3.10/site-packages/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "/home/jeremie/.local/lib/python3.10/site-packages/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/jeremie/.local/lib/python3.10/site-packages/django/contrib/auth/decorators.py" in _wrapped_view

  1. return view_func(request, *args, **kwargs)

File "/mnt/c/E-Health-Care-master/patient/patient_decorators.py" in wrapper_func

  1. return view_func(request,*args,**kwargs)

File "/mnt/c/E-Health-Care-master/patient/views.py" in diabetes

  1. sur=pred_diabetes(ob)

File "/mnt/c/E-Health-Care-master/patient/Diabetes.py" in pred_diabetes

  1. classifier=pickle.load(file)

File "_tree.pyx" in sklearn.tree._tree.Tree.setstate

File "_tree.pyx" in sklearn.tree._tree._check_node_ndarray

Exception Type: ValueError at /patient/diabetes/ Exception Value: node array from the pickle has an incompatible dtype:

`

issue1

Please help resolve

Pradip-p commented 1 month ago

@jeremymikindi , This occurs due to the scikit-learn version. I have updated the requirements.txt file. Please pull the master branch and re-install the requirements