tensorflow_scala | TensorFlow API for the Scala Programming Language | Machine Learning library
kandi X-RAY | tensorflow_scala Summary
kandi X-RAY | tensorflow_scala Summary
This library is a Scala API for It attempts to provide most of the functionality provided by the official Python API, while at the same type being strongly-typed and adding some new features. It is a work in progress and a project I started working on for my personal research purposes. Much of the API should be relatively stable by now, but things are still likely to change.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tensorflow_scala
tensorflow_scala Key Features
tensorflow_scala Examples and Code Snippets
Community Discussions
Trending Discussions on tensorflow_scala
QUESTION
I followed the instructions of this tutorial:
https://www.tensorflow.org/extend/adding_an_op#implement_the_gradient_in_python.
There is this comment provided: g++ -std=c++11 -shared zero_out.cc -o zero_out.so -fPIC -I$TF_INC -I$TF_INC/external/nsync/public -L$TF_LIB -ltensorflow_framework -O2
But the linker cannot find -ltensorflow_framework
(it should be a tensorflow_frameowork.so file!?)
After some research, I found following links:
- https://github.com/tensorflow/tensorflow/issues/1569
- https://github.com/eaplatanios/tensorflow_scala/issues/26 --> I downloaded the .jar and linked it via
-l/pathto/tensorflow_framework.so
, still thefatal error: tensorflow/core/framework/op_kernel.h: No such file or directory
is not found. - https://github.com/tensorflow/tensorflow/issues/1270 last comment does not work and so does not help me.
I tried to search for sudo find /usr/. -name "tensorflow_framework.so"
recursively but I could not find anything. Tensorflow is installed for sure via anaconda and I also cloned and compiled the repository from source.
How to find a way to include the -ltensorflow_framework
?
ANSWER
Answered 2017-Dec-20 at 16:40One answer, I have found:
I have installed my python via anaconda2 and I always tried to find out TF_INC and TF_LIB when I activated my repository source activate
. and the could not found any ~/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow
*.so files
This time I went out every python environment with the shell command source deactivate
and I typed the following command
python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())'
Now, I got a different path: ~/anaconda2/lib/python2.7/site-packages/tensorflow
, where the lib libtensorflow_framework.so
is located.
QUESTION
I am trying to include TensorFlow in my Scala project using this build on MacOS.
As for the installation they provide two ways of doing so:
1) Include the following line to the SBT build:
libraryDependencies += "org.platanios" % "tensorflow" % "0.4.0" classifier "darwin-cpu-x86_64"
However this does not build and gives the following error:
unresolved dependency: org.platanios#tensorflow;0.4.0: not found
2) Build TensorFlow from scratch (which I did via the following steps):
clone the tensorflow git repository
checkout branch r1.12
run
./configure
build using bazel and the following command:
bazel build --config=opt --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 //tensorflow:libtensorflow.so
add libtensorflow.so in a directory that is in LD_LIBRARY_PATH
install protobuf using brew
However, still no success when I want to import tensorflow in my project.
Any ideas on how to fix this?
...ANSWER
Answered 2019-Apr-15 at 14:16I think you just need to specify the scala version (hopefully 2.12) so put tensorflow_2.12 instead of just tensorflow
QUESTION
I have installed Tensorflow for Scala on my OSX, and although everything seemed fine, I have a NoClassDefFoundError when trying to run simple example like that –
...ANSWER
Answered 2018-Mar-01 at 09:07The problem could be due to a missing dependency library of libtensorflow_jni.so
contained by the scala_tensorflow jar
To find the missing library:
sbt console
then from the scala shell import the tensorflow api:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tensorflow_scala
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page