Hi , Can I directly run KotlinDL on mac m1 ?
# kotlindl
s
Hi , Can I directly run KotlinDL on mac m1 ?
z
Hi, you could try and write us about that, I never tested it on m1
I could share hello world project if required
Also you could use datalore for running in web browser
s
I am new to ML , totally not familiar with TF / Keras . I want to learn by programming with KotlinDL , but I am not sure if it has problem on mac m1 . I’ll try it…
Sorry , it seems I need to install TF first
libtensorflow_framework
… I’ll try it later. (not sure if it is compatible with M1 )
https://github.com/apple/tensorflow_macos
Copy code
SUPPORTED VERSIONS
TensorFlow r2.4rc0
TensorFlow Addons 0.11.2
ok . it seems even I successfully install this apple-supported TF (2.4) , it is not compatible with KotlinDL’s TF 1.15 … 🤔
z
@smallufo looks like that you are right about TF versions, but could yet one time clone and run examples from the following project https://github.com/zaleslaw/KotlinDL-Demo
Will it be the same error or not. It will be very helpful
s
At least it doesn’t crash … 😇
Sure . I just cloned , and executed
lenet/LeNetMnist
, it shows :
Copy code
/Library/Java/JavaVirtualMachines/zulu-15.jdk/Contents/Home/bin/java -Dvisualvm.id=6261382111083 -javaagent:/Applications/IntelliJ <http://IDEA.app/Contents/lib/idea_rt.jar=53770:/Applications/IntelliJ|IDEA.app/Contents/lib/idea_rt.jar=53770:/Applications/IntelliJ> <http://IDEA.app/Contents/bin|IDEA.app/Contents/bin> -Dfile.encoding=UTF-8 -classpath /Users/smallufo/projects/KotlinDL-Demo/build/classes/java/main:/Users/smallufo/projects/KotlinDL-Demo/build/classes/kotlin/main:/Users/smallufo/projects/KotlinDL-Demo/build/resources/main:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlin-deeplearning-api/0.2.0/dee7b67768469784fdd2389999f9e33c2ec2a1de/kotlin-deeplearning-api-0.2.0.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.14.0/e257b0562453f73eabac1bc3181ba33e79d193ed/log4j-core-2.14.0.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.14.0/d6003a3b3f24fdb476848f4ecabdb2a43354e410/log4j-slf4j-impl-2.14.0.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.14.0/23cdb2c6babad9b2b0dcf47c6a2c29d504e4c7a8/log4j-api-2.14.0.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.tensorflow/tensorflow/1.15.0/e6a186dca82681e1e28615167e38859b99f82235/tensorflow-1.15.0.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/com.github.doyaaaaaken/kotlin-csv-jvm/0.7.3/e977b275b7ca2f03f42cb839bae2c3b5c6225b24/kotlin-csv-jvm-0.7.3.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/io.jhdf/jhdf/0.5.7/473cdbc05333cafbb30727e2cc676a77c320221c/jhdf-0.5.7.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/com.beust/klaxon/5.5/956f316a8d7a7e41fd10884c79b4826e82c08212/klaxon-5.5.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/io.github.microutils/kotlin-logging-jvm/2.0.4/62f58cd777b1b985a204a10ef80f83278dc939fa/kotlin-logging-jvm-2.0.4.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.tensorflow/libtensorflow/1.15.0/578c89321585d40dbcf7d038dd6c09f2ec744002/libtensorflow-1.15.0.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.tensorflow/libtensorflow_jni/1.15.0/e749c7ce289ad236914657a11b3c198f35ae5f41/libtensorflow_jni-1.15.0.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.4.32/3302f9ec8a5c1ed220781dbd37770072549bd333/kotlin-stdlib-jdk8-1.4.32.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.4.32/3546900a3ebff0c43f31190baf87a9220e37b7ea/kotlin-stdlib-jdk7-1.4.32.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.32/461367948840adbb0839c51d91ed74ef4a9ccb52/kotlin-stdlib-1.4.32.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.30/b5a4b6d16ab13e34a88fae84c35cd5d68cac922c/slf4j-api-1.7.30.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-junit/1.3.50/683d3cf68b1bf58e0fb4529abd46c796d55fb7cd/kotlin-test-junit-1.3.50.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test/1.3.50/92a66b17cc20735cfb1438512210b643813f7516/kotlin-test-1.3.50.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.32/ef50bfa2c0491a11dcc35d9822edbfd6170e1ea2/kotlin-stdlib-common-1.4.32.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.31/63db9d66c3d20f7b8f66196e7ba86969daae8b8a/kotlin-reflect-1.4.31.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.10/e155460aaf5b464062a09c3923f089ce99128a17/commons-lang3-3.10.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-annotations-common/1.3.50/714afde80cb3ee60d41775469cf7412ae622869b/kotlin-test-annotations-common-1.3.50.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-common/1.3.50/667fd8bfc2db0bd546f3b90fe15fe83648437bea/kotlin-test-common-1.3.50.jar:/Users/smallufo/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar LeNetMnistKt
Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot find TensorFlow native library for OS: darwin, architecture: aarch64. See <https://github.com/tensorflow/tensorflow/tree/master/tensorflow/java/README.md> for possible solutions (such as building the library from source). Additional information on attempts to find the native library can be obtained by adding org.tensorflow.NativeLibrary.DEBUG=1 to the system properties of the JVM.
	at org.tensorflow.NativeLibrary.load(NativeLibrary.java:77)
	at org.tensorflow.TensorFlow.init(TensorFlow.java:67)
	at org.tensorflow.TensorFlow.<clinit>(TensorFlow.java:82)
	at org.tensorflow.Graph.<clinit>(Graph.java:479)
	at org.jetbrains.kotlinx.dl.api.core.GraphTrainableModel.<init>(GraphTrainableModel.kt:109)
	at org.jetbrains.kotlinx.dl.api.core.Sequential.<init>(Sequential.kt:25)
	at org.jetbrains.kotlinx.dl.api.core.Sequential$Companion.of(Sequential.kt:39)
	at LeNetMnistKt.main(LeNetMnist.kt:26)
	at LeNetMnistKt.main(LeNetMnist.kt)

Process finished with exit code 1
z
Haha, new strange thing related to tf runtime, in both cases, thank you so much, I will add information about running on different os to the Readme file
Hope, than new runtimes will be added it could be executed directly on the m1
s
So currently I cannot use KotlinDL , right ? Until kotlinDL support TF 2.4 (apple supported) , right ?
z
Yes, if you wish to run it on desktop, I didn't see any way to it. As I understand the virtualization doesn't help you. As I said you could use cloud solutions: EC2, Google Compute Engine or cloud ide like Datalore with Kotlin kernel (it has community unpaid version like Colabs from Google)
2
193 Views