Hi Everyone,

I'm using nupic\opf from C# on Windows (Thanks for doing the work to make
this possible!).  I have a simple console app for testing, and an add-in
extension for another larger commercial application.

I've experimented with a few RPC/bridging approaches:

- Web service (a branch of "htic" project, hacked up to support predictions
- *probably broke anomalies though*):  works well, but request/response
slows everything down (it's not very clean, but you can get the gist here:
https://github.com/erinloy/hitc/blob/master/htm-over-http/htmoverhttp/views_api.py
)

- Python.NET (wrapper for accessing .NET from native python, or in my case,
embedding native python in a .NET app:
https://github.com/pythonnet/pythonnet):  Works in the console app (after a
lot of hacking on the python environment), but chokes on the code
obfuscation in the parent app when trying to discover the contents of all
loaded assemblies.  Probably not a good idea to mix technologies in the
same process - too many bad interactions.

- A regular Windows COM server (via python comtypes library):  This was
easy to build, performs well, and seems to play nice with everything else
by keeping processes separate, and can be extended for remote access if
needed.  I'll probably end up sticking with this option.

In all cases, I can create a model, run data through it, get predictions
back, and save it at checkpoints.  However, the latter two options (not
sure if I tried it with the web service option) give me an error when
trying to load a saved model:

Code:
def load_model(self, modelSaveDir):
        print "Loading model from %s..." % modelSaveDir
        model = ModelFactory.loadFromCheckpoint(modelSaveDir)

Error:
Wrong number or type of arguments for overloaded function 'new_Network'.
  Possible C/C++ prototypes are:
    nupic::Network::Network()
    nupic::Network::Network(std::string const &)

This works when running from native python (via a hacked up onegym sample).
The latest version of Nupic was installed via pip.

Thoughts?

-Erin

Reply via email to