You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: