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

Model Loading is now broken. #102

Closed kkmcgg closed 3 years ago

kkmcgg commented 3 years ago

@donuty-party It seems that you're addition to to the model loading aspect of the script no longer functions. I've manually rolled back and removed the import of the new model.py code so that other features can be used and people can call things in colab etc. We may need to reassess how this model system works. We can either roll back to the original functionality or setup a hierarchy of packages where core.py and model.py are both sub-packages.

I'd like to get back to our original state for now. We may need to discuss this before going forward. Currently we cannot load models.

Traceback (most recent call last):
  File "c:\_dev\Aestheta\Library\core.py", line 22, in <module>
    from .model import Model # currently not working
ImportError: attempted relative import with no known parent package
kkmcgg commented 3 years ago

Perhaps we can use your branch to try and implement the sub-package structure while I roll back to the original setup in our main branch?

ghost commented 3 years ago

@kevinkmcguigan, this is because of the relative import (from .module import Class). You need to run the script as python -m Library.core instead of python Library/core.py. I want to break code out of core.py to prevent it from getting overwhelming. Do you of a way to do that without requiring relative imports?

By the way, this concerns my pull request, too. If you merge that, the same thing will happen.

ghost commented 3 years ago

@kevinkmcguigan Oh, never mind. Absolute imports work fine and don't require us to change how we run the script. I have fixed this in my branch.

kkmcgg commented 3 years ago

oh very good. We will more than likely merge branches shortly I just keep getting pulled away from a deep dive sorry about that. I'm going to take this opportunity to try and set up the library as a proper python package as well - something I don't typically do myself- which should help with handling dependencies and such. l'll leave this open until after the merge

ghost commented 3 years ago

Fixed in 02a5267. This restores the original loadModel() and saveModel() functions, but in so doing, removes the model load by name functionality. I have moved that to the 82-load-model-by-name branch and reopened issue #82.

kkmcgg commented 3 years ago

Thanks for resolving this - we'll sort things out in your branch and move them over to the main.