Does the Caffe machine learning framework + Nvidia DIGITS software work with Python 3? - caffe

I installed Caffe and DIGITs on python 3 and it seems to work partially, however I still get this Protobuf error about version 2.6.1 versus 3.5.
So I reinstalled Protobuf and was then following through with reinstalling Caffe. I have an Anaconda python3.6 environment and I was recompiling Caffe in that environment. During the cmake .. step, I saw that the version of python that is detected is Python2.7 instead of Python3--even though I am in the conda python 3.6 environment. Even the version of numpy detected is for 2.7.:
Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.7")
-- Found NumPy: /home/krishnab/.local/lib/python2.7/site-packages/numpy/core/include (found suitable version "1.11.0", minimum required is "1.7.1")
-- NumPy ver. 1.11.0 found (include: /home/krishnab/.local/lib/python2.7/site-packages/numpy/core/include)
So my real question is whether DIGITS works with Caffe in python 3? I could not find any clear indication in the documentation except for an opaque reference to an issue:
https://github.com/NVIDIA/DIGITS/issues/511
Can anyone clarify?

Related

AllenNLP Server: pip is looking at multiple versions of each package

Within my Conda environment with Python 3.6.9, I've installed AllenNLP 9.2.0. I tried to install AllenNLP Server following the instruction from https://github.com/allenai/allennlp-server by running pip install --editable .
However, the installation procedure never finished as the compatibility checks with several modules, e.g. pip is looking at multiple versions of tqdm to determine which version is compatible with other requirements. This could take a while. Collecting tqdm>=4.19
Does anybody know what happens here? Should I add more restrictions to steup.py in AllenNLP server? However, there is any code included in such file.
Thanks a lot for your help.
I just tried it with AllenNLP 2.0.1 (the latest), and while it takes a long time, it does eventually resolve the packages.
That said, I would recommend two things:
Use Python 3.8 instead.
If it still doesn't work, specify a version of tqdm tightly in the requirements. My version automatically picked tqdm==4.56.2, just or reference.

Can't find dependent libraries when trying to run deeplearning4j with CUDA

I'm attempting to run a neural network built using dl4j using the GPU. The code works fine when using the native platform dependency, but when I switch to using CUDA, execution fails with an exception:
Caused by: java.lang.UnsatisfiedLinkError: ...\cuda-8.0-6.0-1.3-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jnicuda.dll: Can't find dependent libraries
Here is what I have in my build.gradle:
// compile group: 'org.nd4j', name: 'nd4j-native-platform', version: '0.9.1'
compile group: 'org.nd4j', name: 'nd4j-cuda-8.0-platform', version: '0.9.1'
Here are the dependencies showin in IDEA:
I was able to install the CUDA Toolkit and build the examples just fine. Running deviceQuery shows that my CUDA Driver / Runtime version is 9.1, is this a problem since the nd4j-cuda-8.0-platform references 8.0? Not sure, since the version is 0.9.1, which matches my CUDA version and there does not seem to be a 9.0 platform available.
Is there something additional that I'm missing? If so, how do I troubleshoot/resolve this?
So, it turns out there are a few issues. Firstly, deeplearning4j's current release does not support CUDA 9, which I had naively installed thinking the latest and greatest is the best. CUDA 9 is supported on the latest snapshot, which I tried out, but apparently due to some issue with Gradle and snapshots, was unable to resolve the issue.
Ultimately I uninstalled everything relating to CUDA from my PC and installed CUDA 8 from scratch, restarted the computer, and now things seem to be working.

`python: not found` error when fetching Chromium source with `depot_tools`

I'm recently following the Chromium build instructions for Windows but fetch yields the following error:
$ fetch chromium
/c/src/depot_tools/fetch: line 8: exec: python: not found
NB: Python 3.6 is already installed on my PC.
The Windows build instructions fail to specify the required Python version, but the Linux ones are clear:
System requirements
A 64-bit Intel machine with at least 8GB of RAM. More than 16GB is highly recommended.
At least 100GB of free disk space.
You must have Git and Python v2 installed already.
The executable for Python 3.x is python3, and the one for Python 2.x is python, therefore you need to install Python 2.x.

Octave 4.2.1 octave-gui : cannot find libgfortran.so.3

I am currently having an issue with Octave install in Archlinux. I am not able to load the current version of Octave 4.2.1 in Arch. It shows the following message -
/usr/lib/octave/4.2.1/exec/x86_64-pc-linux-gnu/octave-gui: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory
This problem with libgfortran.so.3 is not rare. Here are two similar problems happening in R 1 and 2. If somebody using Octave on Archlinux came across this issue, can you share how to resolve it. Thanks.
From the comments it became apparent that the solution from the referenced question R v3.4.0-2 unable to find libgfortran.so.3 on Arch needs to be appended, because the way the older GCC versions will be typically installed in Arch Linux is in a different path.
So, one must find, where the older version is installed, like
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgfortran.so.3
(depending on the exact GCC version)
and then add the version to LD_LIBRARY_PATH or make a symlik of the library from the above path to /usr/lib64/.
I got this issue because I installed earlier additionally openblas-lapack from AUR for better octave matrix multiplication performance. Updating openblas-lapack to newest version in AUR did the trick for me.

have_header from mkmf throws an error in Jruby

I have this test code :
require 'mkmf'
puts have_header("iostream.h")
this code throws an error in Jruby like this :
checking for iostream.h... RuntimeError: The compiler failed to generate an executable file. You have to install development tools first.
try_do at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:456
try_cpp at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:587
block in have_header at
/home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:1091
block in checking_for at
/home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:942
block in postpone at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:350
open at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:320
block in postpone at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:350
open at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:320
postpone at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:346
checking_for at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:941
have_header at /home/abd/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/mkmf.rb:1090
at test.rb:3
I have no idea what does it mean by development tools and I searched the internet without finding anything about this.
I installed Jruby 9.1.6.0 through rvm, this is my java version :
[abd#abd testruby]$ java -version
openjdk version "1.8.0_112"
OpenJDK Runtime Environment (build 1.8.0_112-b15)
OpenJDK 64-Bit Server VM (build 25.112-b15, mixed mode)
I'm using Arch linux here.
The real reason behind my question is that I tried installing gmp gem and native extensions wouldn't build because of the same error, I know the gem is unmaintained but I want to resolve this issue anyway because the above message suggests that my installation is lacking.
By the way I have the jdk, not just the jre.
JRuby C extensions have been deprecated [and possibly removed already but I'm a bit out of the loop].
Since you're running on the JVM, have you considered the alternatives? i.e. either use Java's BigInteger or BigDecimal if the performance is adequate for your needs, or wrap GMP using JNI / JNA- it looks like somebody has tried already. Check out this SO question for a few more Java alternatives.