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

NotFoundException undefined symbol: _ZN10tensorflow7strings8internal9CatPiecesESt16initializer_listINS_11StringPieceEE #74

Closed pawelpanasewicz closed 6 years ago

pawelpanasewicz commented 6 years ago

There is a problem when running hello world program using this library in version 0.1.0.

Details

Tensorflow version: 1.4.1

lazy val tensorFlowVersion = "0.1.0" "org.platanios" %% "tensorflow" % tensorFlowVersion classifier "linux-cpu-x86_64" val scalaV = "2.11.11"

[error] Caused by: org.platanios.tensorflow.jni.NotFoundException: /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow_ops.so: undefined symbol: _ZN10tensorflow7strings8internal9CatPiecesESt16initializer_listINS_11StringPieceEE

All logs

...
[info] Running mlworthing.HelloScalaTensorflow2 
[debug] Waiting for threads to exit or System.exit to be called.
[debug]   Classpath:
[debug]         /tmp/sbt_206473b5/job-1/target/31f77c7d/introtoml_2.11-0.1-SNAPSHOT-tests.jar
[debug]         /tmp/sbt_206473b5/target/dbf5a125/introtoml_2.11-0.1-SNAPSHOT.jar
[debug]         /tmp/sbt_206473b5/target/50013520/coursier-cache_2.11-1.0.0-RC2.jar
[debug]         /tmp/sbt_206473b5/target/78afb487/circe-core_2.11-0.8.0.jar
[debug]         /tmp/sbt_206473b5/target/ea34d4b6/shapeless_2.11-2.3.3.jar
[debug]         /tmp/sbt_206473b5/target/2f156854/scala-compiler-2.11.11.jar
[debug]         /tmp/sbt_206473b5/target/df612518/plotly-jupyter-scala_2.11-0.3.1.jar
[debug]         /tmp/sbt_206473b5/target/a97b52d5/scalactic_2.11-3.0.4.jar
[debug]         /tmp/sbt_206473b5/target/59bdbd0d/simulacrum_2.11-0.10.0.jar
[debug]         /tmp/sbt_206473b5/target/6c8cf24b/cats-kernel_2.11-0.9.0.jar
[debug]         /tmp/sbt_206473b5/target/c1fc8ac2/upickle_2.11-0.4.4.jar
[debug]         /tmp/sbt_206473b5/target/4ebd1084/scala-xml_2.11-1.0.6.jar
[debug]         /tmp/sbt_206473b5/target/26126c46/circe-parser_2.11-0.8.0.jar
[debug]         /tmp/sbt_206473b5/target/a0df09cc/scalatest_2.11-3.0.4.jar
[debug]         /tmp/sbt_206473b5/target/b32aba0c/protobuf-java-3.4.0.jar
[debug]         /tmp/sbt_206473b5/target/a47cf299/spire_2.11-0.14.1.jar
[debug]         /tmp/sbt_206473b5/target/49524837/plotly-render_2.11-0.3.1.jar
[debug]         /tmp/sbt_206473b5/target/7f4fdfca/spire-macros_2.11-0.14.1.jar
[debug]         /tmp/sbt_206473b5/target/eec0da63/scalaz-concurrent_2.11-7.2.8.jar
[debug]         /tmp/sbt_206473b5/target/e41e288e/tensorflow-data_2.11-0.1.0.jar
[debug]         /tmp/sbt_206473b5/target/92298be2/circe-generic_2.11-0.8.0.jar
[debug]         /tmp/sbt_206473b5/target/0cb87cb7/macro-compat_2.11-1.1.1.jar
[debug]         /tmp/sbt_206473b5/target/731de099/ammonite-util_2.11.11-0.8.3-1.jar
[debug]         /tmp/sbt_206473b5/target/e283d2b7/scala-library-2.11.11.jar
[debug]         /tmp/sbt_206473b5/target/b686cd04/commons-compress-1.15.jar
[debug]         /tmp/sbt_206473b5/target/8aa784e0/proto-1.5.0-rc1.jar
[debug]         /tmp/sbt_206473b5/target/7c4f3c47/logback-classic-1.2.3.jar
[debug]         /tmp/sbt_206473b5/target/54a79251/plotly.js-1.24.1.jar
[debug]         /tmp/sbt_206473b5/target/a7e3e5fb/ammonite-runtime_2.11.11-0.8.3-1.jar
[debug]         /tmp/sbt_206473b5/target/42a25dc3/hamcrest-core-1.3.jar
[debug]         /tmp/sbt_206473b5/target/d3e1f867/circe-numbers_2.11-0.8.0.jar
[debug]         /tmp/sbt_206473b5/target/239a5628/machinist_2.11-0.6.1.jar
[debug]         /tmp/sbt_206473b5/target/15c02491/geny_2.11-0.1.1.jar
[debug]         /tmp/sbt_206473b5/target/0a3f14d0/test-interface-1.0.jar
[debug]         /tmp/sbt_206473b5/target/97b9b3b7/sourcecode_2.11-0.1.3.jar
[debug]         /tmp/sbt_206473b5/target/d1d34cd4/tensorflow-examples_2.11-0.1.0.jar
[debug]         /tmp/sbt_206473b5/target/4e843ea7/scalaz-effect_2.11-7.2.8.jar
[debug]         /tmp/sbt_206473b5/target/7008fd94/circe-simple-generic_2.11-0.3.1.jar
[debug]         /tmp/sbt_206473b5/target/7369d653/scala-parser-combinators_2.11-1.0.4.jar
[debug]         /tmp/sbt_206473b5/target/8ed763d1/coursier_2.11-1.0.0-RC2.jar
[debug]         /tmp/sbt_206473b5/target/7c3c98c6/tensorflow-jni_2.11-0.1.0.jar
[debug]         /tmp/sbt_206473b5/target/8789f8be/scalaz-core_2.11-7.2.8.jar
[debug]         /tmp/sbt_206473b5/target/d52a7bd9/plotly-core_2.11-0.3.1.jar
[debug]         /tmp/sbt_206473b5/target/9c0e4dbb/scalaj-http_2.11-2.3.0.jar
[debug]         /tmp/sbt_206473b5/target/5f42e161/algebra_2.11-0.7.0.jar
[debug]         /tmp/sbt_206473b5/target/63903346/objenesis-2.6.jar
[debug]         /tmp/sbt_206473b5/target/843ca69c/tensorflow-api_2.11-0.1.0.jar
[debug]         /tmp/sbt_206473b5/target/5015fe84/scala-logging_2.11-3.7.2.jar
[debug]         /tmp/sbt_206473b5/target/da76ca59/slf4j-api-1.7.25.jar
[debug]         /tmp/sbt_206473b5/target/c0b7f7e4/jawn-parser_2.11-0.10.4.jar
[debug]         /tmp/sbt_206473b5/target/be02ae0c/cats-macros_2.11-0.9.0.jar
[debug]         /tmp/sbt_206473b5/target/86434440/logback-core-1.2.3.jar
[debug]         /tmp/sbt_206473b5/target/c896acb0/kernel-api_2.11-0.4.1.jar
[debug]         /tmp/sbt_206473b5/target/4800dfc0/scalacheck_2.11-1.13.5.jar
[debug]         /tmp/sbt_206473b5/target/f3dadc1b/derive_2.11-0.4.4.jar
[debug]         /tmp/sbt_206473b5/target/33ee82e3/jsoup-1.10.2.jar
[debug]         /tmp/sbt_206473b5/target/2973d150/junit-4.12.jar
[debug]         /tmp/sbt_206473b5/target/b2f8629c/cats-core_2.11-0.9.0.jar
[debug]         /tmp/sbt_206473b5/target/da3a422f/ammonite-ops_2.11-0.8.3-1.jar
[debug]         /tmp/sbt_206473b5/target/c58a342f/pprint_2.11-0.4.4.jar
[debug]         /tmp/sbt_206473b5/target/f99b5f51/tensorflow_2.11-0.1.0-linux-cpu-x86_64.jar
[debug]         /tmp/sbt_206473b5/target/8b366e1a/fansi_2.11-0.2.3.jar
[debug]         /tmp/sbt_206473b5/target/2addc7e0/scala-reflect-2.11.11.jar
[debug]         /tmp/sbt_206473b5/target/19f9f0bc/circe-jawn_2.11-0.8.0.jar
[debug]         /tmp/sbt_206473b5/target/e75c9f32/scala-api_2.11.11-0.4.2.jar
[debug] Waiting for thread run-main-0 to terminate.
2018-01-29 19:53:49.738 [run-main-0] INFO  TensorFlow Native - Extracting the 'tensorflow_framework' native library to /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow_framework.so.
2018-01-29 19:53:49.826 [run-main-0] INFO  TensorFlow Native - Copied 15846248 bytes to /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow_framework.so.
2018-01-29 19:53:49.827 [run-main-0] INFO  TensorFlow Native - Extracting the 'tensorflow' native library to /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow.so.
2018-01-29 19:53:50.043 [run-main-0] INFO  TensorFlow Native - Copied 50752464 bytes to /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow.so.
2018-01-29 19:53:50.044 [run-main-0] INFO  TensorFlow Native - Extracting the 'tensorflow_jni' native library to /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow_jni.so.
2018-01-29 19:53:50.047 [run-main-0] INFO  TensorFlow Native - Copied 633640 bytes to /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow_jni.so.
2018-01-29 19:53:50.088 [run-main-0] INFO  TensorFlow Native - Extracting the 'tensorflow_ops' native library to /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow_ops.so.
2018-01-29 19:53:50.089 [run-main-0] INFO  TensorFlow Native - Copied 76744 bytes to /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow_ops.so.
[error] (run-main-0) java.lang.ExceptionInInitializerError
[error] java.lang.ExceptionInInitializerError
[error]         at org.platanios.tensorflow.jni.Tensor$.<init>(Tensor.scala:24)
[error]         at org.platanios.tensorflow.jni.Tensor$.<clinit>(Tensor.scala)
[error]         at org.platanios.tensorflow.api.tensors.Context$.apply(Context.scala:50)
[error]         at org.platanios.tensorflow.api.package$.<init>(package.scala:89)
[error]         at org.platanios.tensorflow.api.package$.<clinit>(package.scala)
[error]         at mlworthing.HelloScalaTensorflow2$.delayedEndpoint$mlworthing$HelloScalaTensorflow2$1(HelloScalaTensorflow2.scala:14)
[error]         at mlworthing.HelloScalaTensorflow2$delayedInit$body.apply(HelloScalaTensorflow2.scala:7)
[error]         at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
[error]         at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
[error]         at scala.App$$anonfun$main$1.apply(App.scala:76)
[error]         at scala.App$$anonfun$main$1.apply(App.scala:76)
[error]         at scala.collection.immutable.List.foreach(List.scala:392)
[error]         at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
[error]         at scala.App$class.main(App.scala:76)
[error]         at mlworthing.HelloScalaTensorflow2$.main(HelloScalaTensorflow2.scala:7)
[error]         at mlworthing.HelloScalaTensorflow2.main(HelloScalaTensorflow2.scala)
[error]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]         at java.lang.reflect.Method.invoke(Method.java:498)
[error]         at sbt.Run.invokeMain(Run.scala:89)
[error]         at sbt.Run.run0(Run.scala:83)
[error]         at sbt.Run.execute$1(Run.scala:61)
[error]         at sbt.Run.$anonfun$run$4(Run.scala:73)
[error]         at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error]         at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:10)
[error]         at sbt.TrapExit$App.run(TrapExit.scala:252)
[error]         at java.lang.Thread.run(Thread.java:745)
[error] Caused by: org.platanios.tensorflow.jni.NotFoundException: /tmp/tensorflow_scala_native_libraries6879246935556350101/libtensorflow_ops.so: undefined symbol: _ZN10tensorflow7strings8internal9CatPiecesESt16initializer_listINS_11StringPieceEE
[error]         at org.platanios.tensorflow.jni.TensorFlow$.loadOpLibrary(Native Method)
[error]         at org.platanios.tensorflow.jni.TensorFlow$$anonfun$load$4.apply(TensorFlow.scala:107)
[error]         at org.platanios.tensorflow.jni.TensorFlow$$anonfun$load$4.apply(TensorFlow.scala:107)
[error]         at scala.Option.foreach(Option.scala:257)
[error]         at org.platanios.tensorflow.jni.TensorFlow$.load(TensorFlow.scala:107)
[error]         at org.platanios.tensorflow.jni.TensorFlow$.<init>(TensorFlow.scala:155)
[error]         at org.platanios.tensorflow.jni.TensorFlow$.<clinit>(TensorFlow.scala)
[error]         at org.platanios.tensorflow.jni.Tensor$.<init>(Tensor.scala:24)
[error]         at org.platanios.tensorflow.jni.Tensor$.<clinit>(Tensor.scala)
[error]         at org.platanios.tensorflow.api.tensors.Context$.apply(Context.scala:50)
[error]         at org.platanios.tensorflow.api.package$.<init>(package.scala:89)
[error]         at org.platanios.tensorflow.api.package$.<clinit>(package.scala)
[error]         at mlworthing.HelloScalaTensorflow2$.delayedEndpoint$mlworthing$HelloScalaTensorflow2$1(HelloScalaTensorflow2.scala:14)
[error]         at mlworthing.HelloScalaTensorflow2$delayedInit$body.apply(HelloScalaTensorflow2.scala:7)
[error]         at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
[error]         at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
[error]         at scala.App$$anonfun$main$1.apply(App.scala:76)
[error]         at scala.App$$anonfun$main$1.apply(App.scala:76)
[error]         at scala.collection.immutable.List.foreach(List.scala:392)
[error]         at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
[error]         at scala.App$class.main(App.scala:76)
[error]         at mlworthing.HelloScalaTensorflow2$.main(HelloScalaTensorflow2.scala:7)
[error]         at mlworthing.HelloScalaTensorflow2.main(HelloScalaTensorflow2.scala)
[error]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]         at java.lang.reflect.Method.invoke(Method.java:498)
[error]         at sbt.Run.invokeMain(Run.scala:89)
[error]         at sbt.Run.run0(Run.scala:83)
[error]         at sbt.Run.execute$1(Run.scala:61)
[error]         at sbt.Run.$anonfun$run$4(Run.scala:73)
[error]         at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error]         at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:10)
[error]         at sbt.TrapExit$App.run(TrapExit.scala:252)
[error]         at java.lang.Thread.run(Thread.java:745)
[error] java.lang.RuntimeException: Nonzero exit code: 1
[error]         at sbt.Run$.executeTrapExit(Run.scala:120)
[error]         at sbt.Run.run(Run.scala:73)
[error]         at sbt.Defaults$.$anonfun$bgRunTask$5(Defaults.scala:1152)
[error]         at sbt.Defaults$.$anonfun$bgRunTask$5$adapted(Defaults.scala:1147)
[error]         at sbt.internal.BackgroundThreadPool.$anonfun$run$1(DefaultBackgroundJobService.scala:359)
[error]         at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error]         at scala.util.Try$.apply(Try.scala:209)
[error]         at sbt.internal.BackgroundThreadPool$BackgroundRunnable.run(DefaultBackgroundJobService.scala:282)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error]         at java.lang.Thread.run(Thread.java:745)
[error] (test:run) Nonzero exit code: 1
[error] Total time: 67 s, completed 29-Jan-2018 19:53:51
pawelpanasewicz commented 6 years ago

The problem does not occur in versions 0.1.0-SNAPSHOT or 0.1.1-SNAPSHOT.

sbrunk commented 6 years ago

This bug has been fixed after the 0.1.0 release. See #64 for details. So you have use 0.1.1-SNAPSHOT for now until 0.1.1 is released.