AI Tools from Intel
Find answers to your toolkit installation, configuration, and get-started questions.

One API Null pointer exception

Ujjayanta
Beginner
2,199 Views

I am trying to run the notebook: https://github.com/IntelPython/daal4py/blob/master/examples/daal4py_data_science.ipynb

I am getting an error here:

d4p_lm = d4p.linear_regression_training(interceptFlag=True)
lm_trained = d4p_lm.compute(reduced_dataset.values, target)

RuntimeError                              Traceback (most recent call last)
<ipython-input-73-3f33ed888e39> in <module>
     24 
     25 d4p_lm = d4p.linear_regression_training(interceptFlag=True)
---> 26 lm_trained = d4p_lm.compute(reduced_dataset.values, target)

build\daal4py_cy.pyx in _daal4py.linear_regression_training.compute()

build\daal4py_cy.pyx in _daal4py.linear_regression_training._compute()

RuntimeError: Null pointer in input arguments

 I get this null pointer error in naive bayes and a lot of other examples as well in https://github.com/IntelPython/daal4py/tree/master/examples.

How do I get over these null pointer woes?

0 Kudos
8 Replies
RaeesaM_Intel
Moderator
2,186 Views

Hi ,

 

Thank you for posting in Intel AI Analytics Toolkit Forum.

Can you share the environment details that you used to run the notebook daal4py_data_science.ipynb . Are you using daal4py preinstalled with Intel AI Analytics toolkit environment or separately created a daal4py environment like in https://github.com/IntelPython/daal4py/blob/master/README.md ?

 

We were able to successfully run the notebook using AI environment. Please refer the below link for creating AI environment and install necessary packages.

https://software.intel.com/content/www/us/en/develop/articles/installing-ai-kit-with-conda.html

Also, please make sure that you have run all the cells before "Training the model " section.

 

Thanks and Regards ,

Raeesa

 

0 Kudos
Ujjayanta
Beginner
2,183 Views

Hi 

I have set up my conda environment using:

conda create -n DAAL4PY python=3.6 impi-devel daal daal-include cython jinja2 numpy clang-tools -c intel -c conda-forge

conda activate DAAL4PY

conda install -c intel daal4py

 

 

0 Kudos
RaeesaM_Intel
Moderator
2,170 Views

Hi ,


Can you try these steps :

1.      creating a conda environment and setting environment variable

conda create -n DAAL4PY python=3.7 impi-devel daal daal-include cython jinja2 numpy clang-tools -c intel -c conda-forge

conda activate DAAL4PY

export DAALROOT=$CONDA_PREFIX

export MPIROOT=$CONDA_PREFIX


2.      building daal4py

cd <directory-where-setup.py-is-present>

python setup.py build_ext


3.      installing daal4py

python setup.py install


4.      Installing packages if necessary

conda install -c intel/label/oneapibeta daal4py

pip install matplotlib

pip install pandas


5.      Checking the requirements using python shell

Python

>>>import pandas

>>>import matplotlib

>>>import glob

>>>import sys

>>>import daal4py


Are you using a different dataset or the same one used in notebook (data/batch/cycling_dataset.csv) ? Also check whether all the cells before ‘Training the model’ section are running successfully as expected.


Raeesa


0 Kudos
Ujjayanta
Beginner
2,164 Views

Hi 

What would be the equivalent for the export commands in Windows?

0 Kudos
RaeesaM_Intel
Moderator
2,146 Views

Hi ,


You can use SET in windows equivalent to EXPORT in linux.

So the commands will be ,

set DAALROOT=$CONDA_PREFIX

set MPIROOT=$CONDA_PREFIX

We tried running the notebook in linux and it worked fine,will try out in windows and get back to you on the updates.


Thanks,

Raeesa


0 Kudos
RaeesaM_Intel
Moderator
2,138 Views

Hi Ujjayanta,


We were able to run the notebook without any errors on windows. Could you please try again with these steps :


1.      Creating a conda environment and setting environment variable

conda create -n DAAL4PY python=3.7 impi-devel daal daal-include cython jinja2 numpy clang-tools -c intel -c conda-forge

conda activate DAAL4PY

set DAALROOT=$CONDA_PREFIX

set MPIROOT=$CONDA_PREFIX


2.      Installing packages if necessary

conda install -c intel/label/oneapibeta daal4py

conda install matplotlib

conda install pandas


Regards,

Raeesa


0 Kudos
RaeesaM_Intel
Moderator
2,117 Views

Hi,


Has the solution provided helped you? Please let us know if the issue still persists.




0 Kudos
RaeesaM_Intel
Moderator
2,077 Views

Hi,


We haven't got any updates from your side. We are discontinuing monitoring this thread. Please raise a new query if you have any further issues. We would be happy to help you.


Raeesa


0 Kudos
Reply