I want to use tensorflow 2.3.0 in Java application. I have maven project in Java where I want to import tensorflow 2.3.0 dependencies. How to include tensorflow 2.3.0 dependencies in Java project?
Here is the maven dependency for TensorFlow 2.3.0:
<dependency> <groupId>org.tensorflow</groupId> <artifactId>tensorflow</artifactId> <version>2.3.0</version> </dependency>
You can include this in your project. This will download TensorFlow 2.3.0 dependency for Java.
If your system has GPU support and you want to use GPU for your machine learn program then add the following TensorFlow dependencies in pom.xml file of your project:
<dependency> <groupId>org.tensorflow</groupId> <artifactId>libtensorflow</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>org.tensorflow</groupId> <artifactId>libtensorflow_jni_gpu</artifactId> <version>2.3.0</version> </dependency>
Now we will talk about the minimum dependency requirement of Python for running TensorFlow 2.3.0.
TensorFlow 2.3.0 is released with many new features and improvements. TensorFlow 2.3.0 has minimum dependency requirement of Python.
I tried to install TensorFlow 2.3.0 on Python 3.6 but it failed. The Minimum Python requirement is Python 3.7. TensorFlow 2.3.0 does not support Python 2.7.
Here are steps of install TensorFlow 2.3.0 on Anaconda Python:
Step 1: Create Python 3.7 virtual environment
conda create --name tf2.3.1 python=3.7
Step 2: Activate the environment
conda activate tf2.3.1
Step3: Install TensorFlow 2.3.0
pip install tensorflow==2.3.0
Step 4: Check TensorFlow version
Now open python terminal and then run following code to check TensorFlow version:
import tensorflow as tf print(tf.__version__)
It should print 2.3.0 on the console.
Check more details at Install TensorFlow 2.3.0 on Google Colab.