Importlib error


#1

Running nupic on Windows and doing the hotgym tutorial the swarm.py program puts the model in the model_params directory. run.py looks for it there but since there’s no init.py it errors out on importlib.
Need to add init.py to the directory in the code

Mike


#2

Which hotgym tutorial are you running? I’m not absolutely certain they run properly on Windows. When I built the older hotgym tutorials, Windows was just a speck on the horizon. Also, did you get it working? Did you have a question?


#3

Running examples\opf\clients\hotgym\prediction\one_gym>
There is a init.py in the git repository. But running the thing outside of it does the directory but not the init.py.

Mike


#4

But there is an __init__.py in the model_params:

https://github.com/numenta/nupic/blob/master/examples/opf/clients/hotgym/prediction/one_gym/model_params/init.py


#5

Yes…it’s in the git repository…but it does not get created automatically like it should be.
Go ahead and delete it and try re-running the training and it won’t get created.

Mike


#6

Sorry, I’m still confused! :confused: Why would you delete the __init__.py file in the first place? There is a cleanup.py script, and it doesn’t delete that file. It is checked into git, it needs to be there.


#7

Because I don’t run code in the git directory.
I copied the scripts outside – logically figuring it would create the model_params directory which it does…just not the init.py that run.py needs.

Logically one would just take the necessary scripts and modify the config file for their data and run it somewhere else.


#8

Put another way…swarm.py checks to see if the directory exists and, if not, creates it. It then needs to put the init.py inside to complete the action it has taken.


#9

But have you figured out how to get it to run at this point or are you still having trouble?

The examples are designed to be run in place in the repository, so if they don’t work when moved somewhere else (especially if some of the files are not moved) then there’s not much to do about that.


#10

Yes, running fine now. Just pointing out a software bug.
I’m a python idiot so took me a while to figure out why run.py wasn’t working.


#11

Great! Thanks for helping out. Let me know how it goes.


#12

By the way, @mdblack, I recently fixed this bug.