# AEM

Published articles for AEM.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Tensorflow and AEM

DevFeed: [Tensorflow and AEM](<https://devfeed.tech/articles/tensorflow-and-aem-21533.md>)

Original publisher: [Read original article](<http://lifepluslinux.blogspot.com/2017/12/tensorflow-and-aem.html>)

Author: Suresh Alse (noreply@blogger.com)

Published: 2017-12-17T20:40:00Z

Content type: tutorial

Language: en

Sources: [Life Plus Linux](<https://devfeed.tech/sources/life-plus-linux.md>)

Topics: [Tensorflow](<https://devfeed.tech/topics/tensorflow.md>), [Java](<https://devfeed.tech/topics/java.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [Deep learning](<https://devfeed.tech/topics/deep-learning.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>)

Tags: [aem](<https://devfeed.tech/tags/aem.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [deep-learning](<https://devfeed.tech/tags/deep-learning.md>), [deeplearning](<https://devfeed.tech/tags/deeplearning.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [guide](<https://devfeed.tech/tags/guide.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [java](<https://devfeed.tech/tags/java.md>), [ml](<https://devfeed.tech/tags/ml.md>), [tensorflow](<https://devfeed.tech/tags/tensorflow.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

A tutorial on setting up TensorFlow for Java in Adobe Experience Manager and other Felix-based systems. It covers Maven and bundle configuration, JNI installation, library placement, and testing with a Sling servlet.

### Source excerpt

It has been a while since google released Tensorflow support for java. Even though it is still in its infancy, I feel like it has everything we need. Build computation graphs - check, run session and compute stuff - check, GPU support - check. Now if you have all the time in the world to reinvent the wheel, you can pretty much build anything in java that we can build using python or c++. So, I have been working on Adobe Experience Manager since I joined Adobe and recently, I started experimenting with several use cases where machine learning can help in content creation and discovery. As I have zero knowledge in building any deep learning models in java, I decided to build everything in java. How hard can it be? Right? Right? Sarcasm aside, as I mentioned earlier, Tensorflow for java has everything we need and as it internally uses JNI we can have interoperability with python and c++ (that's why I preferred this over deeplearning4j). First off, I followed their official guide for the setup and had to face a lot of hurdles along the way. In this post I will show you how I managed to successfully setup Tensorflow on AEM (or any felix based systems). Step 1 Add the dependency to your pom.xml file. Note that the scope set to compile. Step 2 Add this configuration to your maven-bundle-plugin. Step 3 Build and install to your AEM instance. Then, navigate to /system/console/bundles/ and look for the bundle which contains the dependency. See if the "Exported Packages" section has the following packages: Step 4 Install JNI if necessary (this is mentioned in the link that I shared earlier). Then place the library file in the appropriate place. Testing Lets write a simple sling servlet to check if everything is working as expected. Like I told earlier, Tensorflow for java is still in its infancy. So, I wrote a helper class a while back to manipulate the computation graph. Get GraphBuilder.java and place it where it is accessible to the sling servlet. GraphBuilder.java The foll