Importlib error

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

1 Like

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?

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

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

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

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.

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.

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.

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.

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.

1 Like

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

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