NSCC-COGS / Aestheta

An Industrial Think Tank Focused on Developing and Promoting AI Technology for Geospatial Applications [Please note this group was formed as an academic exercise for educational purposes and does not represent a real world organization]
MIT License
7 stars 3 forks source link

core.py crashes on currently enabled test #56

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hey Kevin, do you know offhand what's going on here?

/content/Aestheta/Library/core.py in loadModel(name, model_dir)
    125     filename = model_dir+newest_model
    126     print(filename)
--> 127     classModel, classes = pickle.load(open(filename, 'rb'))
    128 
    129     return classModel, classes

sklearn/tree/_tree.pyx in sklearn.tree._tree.Tree.__cinit__()

ValueError: Buffer dtype mismatch, expected 'SIZE_t' but got 'int'
kkmcgg commented 3 years ago

My guess is that the load is failing due to the file not existing or perhaps the path generated is incorrect. Perhaps if we set the python environment variables to the astheta workspace it would ensure the path is correct - but that may not be a best practice

kkmcgg commented 3 years ago

I dug in a bit more. This fails in a similar way when pulling things to google colab. Searching around it seems that this maybe an issue caused by building the model on a 32-bit machine. AND as it turns out my laptop's python version was set to 3.8.1 32! Good find as I certainly was not using 32 bit intentionally.

This is a good learning note to everyone - it seems we can likely add '64bit version of python' to the list of our requirements

I will switch over to 64-bit python, regenerate the model and close the issue if it works. Thanks again Jeff!

Relevant stack overflow post: https://stackoverflow.com/questions/21033038/scikits-learn-randomforrest-trained-on-64bit-python-wont-open-on-32bit-python

kkmcgg commented 3 years ago

https://github.com/NSCC-COGS/Aestheta/blob/e67cb26f2e9a47d1b98be0be8e6974cdfe2e2738/Library/core.py#L121 implemented model saving/loading for 32 bit and 64 bit python