eaplatanios / tensorflow_scala

TensorFlow API for the Scala Programming Language
http://platanios.org/tensorflow_scala/
Apache License 2.0
936 stars 96 forks source link

Extracting native libraries each time JVM starts #90

Closed MrVPlusOne closed 6 years ago

MrVPlusOne commented 6 years ago

Hi, I'm new to Tensorflow-scala. I noticed that every time I run my code, the library extracts native libraries to a temporary directory. Is there a way to prevent this extracting and copying from happening? I managed to reuse 'libtensorflow.so' and 'libtensorflow_framework.so' by setting the environment variable 'LD_LIBRARY_PATH', but I couldn't figure out how to do this for 'libtensorflow_jni.so' and 'libtensorflow_ops.so'.

eaplatanios commented 6 years ago

@MrVPlusOne It's true those libraries are extracted every time and that's because they're package in the distributed JAR file. It's only a few KBs in size and so should not contribute a performance penalty. Are you experiencing a significant slow down due to the extraction?

MrVPlusOne commented 6 years ago

No, I didn't experience any significant slowdown. It's just a little annoying that each time the library has to do this. Nevermind then.

eaplatanios commented 6 years ago

I could change the logging level to debug for the messages. Would that be better?

MrVPlusOne commented 6 years ago

I guess so?

eaplatanios commented 6 years ago

Done! :)