microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.53k stars 4.28k forks source link

Debugging Issue on Mac with docker #2767

Open DHOFM opened 6 years ago

DHOFM commented 6 years ago

Hi, I tried to debug CNTK on my new MBP also. So i downloaded the correct docker image and the Python Notebook runs well connecting from the Host ( Mac OS) to docker. Now debugging is the next setup. Using Pycharm Professional, setting up a docker remote interpreter is no problem, by selecting the project interpreter set to image name: microsoft/cntk:2.3-cpu-python3.5 and python interpreter path set to: /root/anaconda3/envs/cntk-py35/bin/python

So debugging a simple script says:

File "/root/anaconda3/envs/cntk-py35/lib/python3.5/site-packages/cntk/cntk_py.py", line 18, in swig_import_helper return importlib.import_module(mname) File "/root/anaconda3/envs/cntk-py35/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 'cntk._cntk_py'

So I guess any Path is missing in this environment with PyCharm on the host machine. Has anyone suggestions how to debug CNTK on docker from a Mac OS Host ???

Kind regards,

Dirk

DHOFM commented 6 years ago

no one any ideas ? Logging into container and running cant from the command line in the container works. it seems that the path to cntk_py.py cannot be found when debugging ???

hellosaumil commented 6 years ago

Can you try writing just cntk in the anaconda env shell and share the output?

PS - I have MBP 2017 and I have installed CNTK using Docker.

DHOFM commented 6 years ago

Thanks for your response 😁 Logging into the container it works showing: docker exec -i -t 26b830dc96cc /bin/bash


Welcome to Microsoft Cognitive Toolkit (CNTK) v. 2.3

Activating CNTK environment...

(Use command below to activate manually when needed)

source "/cntk/activate-cntk"


CNTK is activated.

Please checkout tutorials and examples here: /cntk/Tutorials /cntk/Examples

To deactivate the environment run

source /root/anaconda3/bin/deactivate


(/root/anaconda3/envs/cntk-py35) root@26b830dc96cc:/opt/project# cntk

Build info:

    Built time: Nov 22 2017 21:43:24
    Last modified date: Wed Oct 18 15:58:31 2017
    Build type: release
    Build target: CPU-only
    With 1bit-SGD: no
    With ASGD: yes
    Math lib: mkl
    Build Branch: HEAD
    Build SHA1: feade5b1bc1fbe6a8fc13b214f66aa89dac0db53
    MPI distribution: Open MPI
    MPI version: 1.10.7

No command-line argument given.

Usage: cntk configFile=yourConfigFile For detailed information please consult the CNTK book "An Introduction to Computational Networks and the Computational Network Toolkit"

## But running from the Pycharm Python Console it does not work and shows: Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06) Type 'copyright', 'credits' or 'license' for more information IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help. PyDev console: using IPython 6.1.0 Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux cntk Traceback (most recent call last): File "/root/anaconda3/envs/cntk-py35/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2862, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in cntk NameError: name 'cntk' is not defined

DHOFM commented 6 years ago

@hellosaumil By the way - what IDE do you use for debugging python and docker ? PyCharm, VS Code or anything else ??? Thanks, Dirk