skip-ganomaly icon indicating copy to clipboard operation
skip-ganomaly copied to clipboard

ImportError: No module named 'lib.models.{model_name}'

Open matak07 opened this issue 5 years ago • 0 comments

While trying to run train.py, I got the following error:

Traceback (most recent call last): File "train.py", line 33, in main() File "train.py", line 29, in main model = load_model(opt, data) File "/////codes/skip-ganomaly-master/lib/models/init.py", line 20, in load_model model_lib = importlib.import_module(model_path) File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 956, in _find_and_load_unlocked ImportError: No module named 'lib.models.{model_name}'

I actually rectified it by changing a line in ./lib/models/init.py. change: model_path = "lib.models.{model_name}" to: model_path = "lib.models.{}".format(model_name)

And the codes start running. I just wanted to know if this is correct or is there any other solution. Also, I am running this code on Python 3.5. Will that affect the functionality of the code? Thanks. Any help appreciated.

matak07 avatar Aug 25 '19 08:08 matak07