NVIDIA / DIGITS

Deep Learning GPU Training System
https://developer.nvidia.com/digits
BSD 3-Clause "New" or "Revised" License
4.12k stars 1.38k forks source link

[Windows] digits-devserver - invalid syntax #1149

Open SergeBE opened 7 years ago

SergeBE commented 7 years ago

I'm not sure how stupid the question is, but I found nothing on Google and I have no idea what to do, so I have to ask it.

I try to run Digits on Windows with help of this guide ( https://github.com/NVIDIA/DIGITS/blob/820c82f257233845f21a9ef2addd84d3c59cf006/docs/BuildDigitsWindows.md ) and I think I have done everything correctly. Now, when I try " python digits-devserver ", I get a invalid syntax error. I have never worked with python before and I have no idea what to do.

Error: File "digits-devserver", line 6 python -m digits $@ ^ SyntaxError: invalid syntax

lukeyeager commented 7 years ago

Hey @IsaacYangSLA will you update the Windows documentation for me? I broke it when I switched digits-devserver from a Python script to a Shell script in https://github.com/NVIDIA/DIGITS/pull/1121.

SergeBE commented 7 years ago

Ok, so the question wasn't too stupid :-)

Another thing: Can I just start Digits using "python digits" in the cmd-line? Because I get an error doing so, saying:

pkg_resources._vendor.packaging.version.InvalidVersion: Invalid version: 'CAFFE_VERSION'

If I try "caffe --version" I get that caffe version is 1.0.0-rc3.

Is this error related to my original question somehow?

IsaacYangSLA commented 7 years ago

We might need to update Windows document because current instruction does not ask users to 'install DIGITS' as one python package. I guess it can be done on Windows with Run CMD.exe as administrator.

python -m pip install -e $DIGITS_ROOT

Then python -m digits should work. However, I haven't had time to try it.

The 'CAFFE_VERSION' might be related to that pycaffe in Windows does not correctly define __version__.

korabelnikov commented 7 years ago

i have pkg_resources._vendor.packaging.version.InvalidVersion: Invalid version: 'CAFFE_VERSION' too

https://github.com/Microsoft/caffe/pull/85/commits/4fd0f69a6f6fb9db443ed1d9a457ef2240137b56

doesn't help

I think, it's important. @SergeBE , are you also using caffe from https://github.com/Microsoft/caffe ?

SergeBE commented 7 years ago

I'm using caffe from https://github.com/bvlc/caffe/tree/windows

Should we maybe open a new Issue with this?

SergeBE commented 7 years ago

@korabelnikov

Ok, so I applied the changes you suggested ( link ), the first change was allready there, I just had to apply the second one. Then, after rebuilding Caffe, I can start Digits without getting the version error.

Btw, I still cant start digits-devserver, even after I tried python -m pip install -e $DIGITS_ROOT But I can use python -m digits, so thats okay.

vfdev-5 commented 7 years ago

@SergeBE , you say that you use https://github.com/bvlc/caffe/tree/windows and if I am correct, when you build it, then caffe.exe can be found at <caffe_source>/Build/x64/Release So, when you run python -m digits, you do not have a problem with digits\config\caffe.py file ? Which version of DIGITS you use ?

@lukeyeager In my case, I take the master branch of DIGITS with a custom merge of bvlc/caffe for windows and nvidia/caffe (the building folder is still <caffe_source>/Build/x64/Release) and I have the following error :

"C:\dl\caffe" from CAFFE_ROOT does not point to a valid installation of Caffe
.
Use the envvar CAFFE_ROOT to indicate a valid installation.
Traceback (most recent call last):
  File "c:\python27\Lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\dl\DIGITS\digits\__main__.py", line 66, in <module>
    main()
  File "C:\dl\DIGITS\digits\__main__.py", line 49, in main
    import digits.config
  File "digits\config\__init__.py", line 7, in <module>
    from . import caffe
  File "digits\config\caffe.py", line 225, in <module>
    executable, version, flavor = load_from_envvar('CAFFE_ROOT')
  File "digits\config\caffe.py", line 30, in load_from_envvar
    % executable_dir)
ValueError: Caffe executable not found at "C:\dl\caffe\build\tools"
SergeBE commented 7 years ago

Yeah, I changed .../digits/config/caffe.py so that Digits finds caffe and pycaffe.

So I changed:

line 24: python_dir = os.path.join(value, 'pycaffe') line 27: executable = find_executable_in_dir(value)

Probably not a great solution, but it works right now. Haven't tried to do anything with Digits yet, but at least it opens. Digits Version: 4.1

korabelnikov commented 7 years ago

The cause of notfounding caffe executable was in CAFFE_ROOT environ variable. If it is setted, scipt can't find caffe.exe.

so, it need a fix if it is a bug in .py scipt or just add documentation

DiegoHerrera1890 commented 5 years ago

Hello Everyone. Thanks for all your post. Perhaps is too late... but I'm trying to run Digits in Windows 10. I followed all the steps, but I'm Stuck here: ` C:\Windows\System32\DIGITS>python -m digits error C:\Program Files\Anaconda3\lib\site-packages\gevent\monkey.py:395: RuntimeWarning: Monkey-patching not on the main thread; threading.main_thread().join() will hang from a greenlet _warnings) Traceback (most recent call last): File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 673, in _load_unlocked File "", line 665, in exec_module File "", line 222, in _call_with_frames_removed File "C:\Windows\System32\DIGITS\digits\webapp.py", line 25, in app.config['SECRET_KEY'] = os.urandom(12).encode('hex') AttributeError: 'bytes' object has no attribute 'encode' During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\Anaconda3\lib\runpy.py", line 184, in _run_module_as_main "main", mod_spec) File "C:\Program Files\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Windows\System32\DIGITS\digits__main.py", line 70, in main() File "C:\Windows\System32\DIGITS\digits__main__.py", line 55, in main import digits.webapp File "", line 969, in _find_and_load File "", line 171, in exit__ File "", line 123, in release RuntimeError: cannot release un-acquired lock

`