Import cntk modul in python - Linux
Hi,
I'm trying to load cntk module from my python code. Examples run ok. Cntk is activated.
Error is on import line from cntk.ops.functions import load_model
Error message is ImportError: No module named 'cntk'
Thanks for answering Tereza
assuming you are able to import CNTK - import CNTK. Could you please try from cntk.ops import load_model
I followed this instructions https://github.com/Microsoft/CNTK/wiki/Setup-Linux-Binary-Script and everything was fine, including an example from Tutorials.
My cgi script:
#!/usr/bin/python3
import cgi
import cntk
from cntk.ops import load_model
print("Content-type: text/html\n\n")
print("hi there")
When I try to run it ( python3 my_file.py ) I get this message
import cntk
ImportError: No module named cntk
Maybe it's permission thing. I'll check this out.
@sayanpa Hi, I know where is the problem. It's something about running python script via CGI. Maybe you could help me with something else. I tried to run my python script on my home computer with windows. Import is correct but there is a problem with loading a model. I found the similar issue here https://github.com/Microsoft/CNTK/issues/1179.
Error message is Value error: The convolution map should have at least as many axes as the shape of the input it operates on. Input is image 256x256x3. It's weird that the same error appeared in c++ code of @dmagee too.