DIGITS icon indicating copy to clipboard operation
DIGITS copied to clipboard

Please add python 3 support

Open abdulmuneer opened this issue 8 years ago • 30 comments

Hi, We are using DIGITS in our organization along with internally developed applications. The lack of support for Python3 for DIGITS is preventing us too from using it. Do you have any plan to port it to python 3?

abdulmuneer avatar Jan 14 '16 06:01 abdulmuneer

We don't have plans to do this anytime soon, no. However, you're the first to ask for it - we might consider it if enough people ask or upvote this request.

If you'd like to contribute small, incremental updates towards Python3 support like e7b3466dbf82dffad0ffb7d771ba589d7c255968 (from https://github.com/NVIDIA/DIGITS/pull/501), I'd be happy to review them.

lukeyeager avatar Jan 14 '16 17:01 lukeyeager

Thank you. I will send PRs with incremental updates.

abdulmuneer avatar Jan 18 '16 08:01 abdulmuneer

Well, we're also using python 3 and all libraries we use (numpy, scipy, scikit-learn, theano and many others) have python 3 support for some time now, we'd love it if Digits/Caffe went the same way.

I don't think that upvotes for this request actually represents the need.

enedene avatar Jan 29 '16 07:01 enedene

I would like to have python3 support too.

Josca avatar Nov 07 '16 13:11 Josca

+1 more for Python 3 support

jms90h5 avatar Nov 20 '16 19:11 jms90h5

+1

cmastudios avatar Dec 04 '16 21:12 cmastudios

+1

Thanks for considering supporting Python 3. I'm sure you're aware that the original EOL for python 2 was set to 2015. It has been extended to 2020 but basically python 2 is dead. All major AI frameworks (including Caffe, TF, CNTK) support python 3 so it would be great to see DIGITS move in that direction as well. Limiting support to python 2 only muddles the python environments where we have to keep a special environment just for DIGITS while everything else runs on python 3.

achaiah avatar Dec 07 '16 18:12 achaiah

+1

alpop avatar Dec 27 '16 19:12 alpop

+1. I'm avoiding starting any projects in Python2 for the reasons listed above.

dapperfu avatar Jan 02 '17 05:01 dapperfu

Update: My Python3 fork is unmaintained.

Original Post:

I spent the weekend hacking through more 2->3 migration stuff to the point where I'm happy tagging it as working.

I've tested it with the Dolphin & Seahorses Have Fun with Machine Learning classification example. Next free time sprint I will try to work through all the other examples.

If anyone is interested in using DIGITS on Python 3 it would be a big help if you could try to use your use cases to figure out where the pain points are and report any additional bugs.

Tested Environment:

  • Ubuntu 16.04 x86_64
  • CUDA 8.0 w/cudnn 5.1
  • Python 3.5.1 (apt-get install python3)
  • Numpy 1.11.0 (apt-get install python3-numpy)

I built OpenCV and Caffe for Python3, CUDA8, etc. For simplicity here are the binaries. Install opencv with dpkg and exatract caffe-distribute.

  • https://jed-frey.github.io/files/opencv3_3.2.0-1_amd64.deb build script
  • https://jed-frey.github.io/files/caffe-distribute.tar.bz2 build script

If you run into any problems or have any questions open an issue on my forked repo.

https://pythonclock.org/

dapperfu avatar Jan 30 '17 18:01 dapperfu

Dear Jef-rey

can i tried to use in windows 8.1 ? and i already to install all dependencies for this. using python 3.5.3, and i need to set to cpu only

here the result

C:\DIGITS>python -m digits

Traceback (most recent call last):

File "C:\Users\MyPC\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec)

File "C:\Users\MyPC\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in run_code exec(code, run_globals)
File "C:\DIGITS\digits_main
.py", line 72, in main() File "C:\DIGITS\digits_main_.py", line 57, in main import digits.webapp File "C:\DIGITS\digits\webapp.py", line 48, in import digits.views # noqa File "C:\DIGITS\digits\views.py", line 648, in app.register_error_handler(code, handle_error)
File "C:\Users\MyPC\AppData\Local\Programs\Python\Python35\lib\site-packages\flask\app.py", line 1170, in register_error_handler self._register_error_handler(None, code_or_exception, f) File "C:\Users\MyPC\AppData\Local\Programs\Python\Python35\lib\site-packages\flask\app.py", line 64, in wrapper_func return f(self, *args, **kwargs) File "C:\Users\MyPC\AppData\Local\Programs\Python\Python35\lib\site-packages\flask\app.py", line 1185, in _register_error_handler exc_class, code = self._get_exc_class_and_code(code_or_exception) File "C:\Users\MyPC\AppData\Local\Programs\Python\Python35\lib\site-packages\flask\app.py", line 1104, in _get_exc_class_and_code exc_class = default_exceptions[exc_class_or_code] KeyError: 402 C:\DIGITS>python -m digits-devserver C:\Users\MyPC\AppData\Local\Programs\Python\Python35\python.exe: No module named digits-devserver

#using digits-devserver C:\DIGITS>python digits-devserver

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

Thx

MyAusweis avatar Mar 31 '17 07:03 MyAusweis

^ That's not related to either Python3 or Windows. You're trying to run a bash script (see the first line) with Python. Don't do that. Just start the server with python -m digits like the script is trying to do.

lukeyeager avatar Mar 31 '17 16:03 lukeyeager

https://pythonclock.org/

dapperfu avatar Sep 29 '17 12:09 dapperfu

does digits 6.0 support python3?

201power avatar Apr 28 '18 01:04 201power

No. You can't even run setup.py because of the Python2-isms.

python setup.py install
Traceback (most recent call last):
  File "setup.py", line 11, in <module>
    execfile(os.path.join(LOCAL_DIR, 'digits', 'version.py'), {}, version_locals)
NameError: name 'execfile' is not defined

And requirements.txt has a Python2 only version of pydot selected.

    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-cglb3f20/pydot/setup.py", line 6, in <module>
        import pydot
      File "/tmp/pip-install-cglb3f20/pydot/pydot.py", line 31
        except Exception, e:
                        ^
    SyntaxError: invalid syntax

And if you skip setup.py, fix the versions in requirements, it fails to start because of the print functions.

SyntaxError: Missing parentheses in call to 'print'

My DIGITS5 Python3 branch above still works. I haven't played with machine vision in a while and don't currently have the motivation ($) to work on a Python3 DIGITS6 release.

I just tossed up a Bounty Source if it's something DIGITS users really want: https://www.bountysource.com/issues/57707267-digits6-update.

[And the reason I haven't submitted any pull requests of my Python 3 changes is because of the CLA]

dapperfu avatar Apr 28 '18 16:04 dapperfu

Please add python3 support this has been open since 2016....

It's 2018 guys...

xemose avatar Jul 14 '18 14:07 xemose

+1 - Tensoflow is only available on Python 3 for Windows. It took me ages just to get your out-dated DIGITS to work on Windows because your digits has such old requirements it's hard to cobble together and source the old libraries. After all of that I find that it won't run Tensorflow - so I feel that I wasted my time on your training (which was digits based), I've wasted my time installing DIGITS and for what? Like the last guy said, it's 2018 and the request has been there since 2016 - which seems like the last date that you seriously updated DIGITS anyway.

LeitchP avatar Jul 21 '18 09:07 LeitchP

From the errors people are reporting, it seems the only real change needed to upgrade Digits for Python 3 is the syntax for print. Since in Python3 print is used as print('String') instead of print 'String'

tl;dr add parentheses to the inside of print statements?

Did anyone find any errors that's not related to syntax? I'm thinking of just running a script through Digits' source code to update the print statements.

xemose avatar Jul 24 '18 06:07 xemose

+1 (like)

dqthebt24 avatar Jul 30 '18 14:07 dqthebt24

@xemose:

From the errors people are reporting

Look at my fork and Python3 version of DIGITS 5. There's a lot more "Python 2 isms" in there than just print. (Which is trivial to support both with __future__ module). The only reason 'print' is what is reported is that is what fails first.

I did the conversion in about a weekend. There are probably edge use cases that will fail. But I don't have the motivation to provide Nvidia free work on DIGITS 6. If they really see value in this project it should be trivial to get an Intern to work on it. But if NVidia doesn't care enough to do that at the minimum it's not worth my time to do it for them.

Alternatively, https://www.bountysource.com/issues/57707267-digits6-update

dapperfu avatar Jul 30 '18 18:07 dapperfu

My digits3 fork is no longer maintained for reasons listed in later comment.

dapperfu avatar Aug 30 '18 07:08 dapperfu

Also need python3 support please.

ysya avatar Oct 03 '18 07:10 ysya

Also need python3 support please.

BrikerMan avatar Oct 24 '18 03:10 BrikerMan

So..... this is becoming a real problem. On one hand, this installs and runs really easily on Docker. On the other hand, getting the results to work with Python3 isn't always easy, especially since all your training is on Python 2.7. I'm just about to fork out big $$ on NVidia - why not update the tools that make using NVidia simple?

LeitchP avatar Oct 24 '18 03:10 LeitchP

Starting Jan 1., 2019, all new releases of numpy will only support python-3.

This is incompatible with Digits not supporting python-3.

If Digits doesn't support python-3, we'll have to stop using it soon.

Are you planning support for python-3?

michaelholm-PN avatar Jan 31 '19 18:01 michaelholm-PN

Jetson Nano doesn't have TensorFlow support for Python2.7. so it's impossible to run DIGITS with TensorFlow support on the Nano

andreyyruski avatar May 16 '19 19:05 andreyyruski

Officially? Created a fork for DIGITS on Python3.

  • 506 open issues.
  • 26 Pull Requests.
  • You will need to send a signed copy of the Contributor License Agreement to [email protected] before your change can be accepted.

Developers absolutely welcome because NVIDIA did a great of obfuscation with the lack of documentation everywhere.

@jed-frey

Sorry to bother you, but I recently face the same problem to make DIGITS work with python3, however when I go to your link, I find the readme says that "it is no longer developed since there are other better options in 2019", may I ask what are the better options, you mean DIGITS provide support for python 3 or other applications? Thanks in advance.

richardcoder avatar Oct 02 '19 06:10 richardcoder

@richardcoder, Sorry I didn't get back to you sooner. For some reason GitHub didn't show me the notification in this thread.

A bit of a backstory on the existence of DIGITS3. I started playing with machine learning back in 2017. I found DIGITS and immediately loved it. I got tinkering under the hood and just wanted to see how much it would take to convert to Python 3. A long the way I learned how to use Flask, blueprints, etc.

However all of my changes were a big tear up of the code, it wasn't mergeable. NVIDIA seemed to have no interest in doing any work internally to convert to Python3, so I lost interest. This seems to be a perpetual problem with large companies and open source. It's not an immediate profit line in a budget so it's not "worth" it.

Better options for a 1:1 copy of digits with a web gui, user accounts, etc. Nothing I know of (but that's not my use case.)

PyTorch, Tensorflow and other higher level libraries have gotten a lot better since 2017 so I've moved to them for my ML stuff.

I'd be happy to have a hackathon with Nvidia updating it to Python3 in a crash week for some free pizza or a TITAN card, but it doesn't seem like NVIDIA really cares much about this product anymore. For example it supports "Ubuntu 14.04, 16.04". Ubuntu's next LTS 2020 is coming. I've been on 18.04 for 16 months.

DIGITS seems to be on life support and NVIDIA pulled the rug out from under those that built their work around it.

Also, I don't want sign away my contributor rights to NVIDIA. 2¢

dapperfu avatar Dec 08 '19 23:12 dapperfu

+1 more for Python 3 support

ai408 avatar Jan 06 '20 01:01 ai408

#2210 I am having similar issue making Nvidia Digits work with python3 after I have installed caffe and tensorflow with python 3. Is anyone been able to successfully build, install and use Nvidia Digits with Caffe, tensorflow on python 3?

spurani avatar Feb 12 '20 09:02 spurani