Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to TensorFlow 2 #29

Open
frauzufall opened this issue Dec 28, 2020 · 0 comments
Open

Upgrade to TensorFlow 2 #29

frauzufall opened this issue Dec 28, 2020 · 0 comments

Comments

@frauzufall
Copy link
Member

I'll just use this issue to save some notes regarding the upgrade:

The new maven dependency for all operating systems (tensorflow-core-platform-mkl-gpu for GPU support though that didn't immediately work for me):

<dependency>
    <groupId>org.tensorflow</groupId>
    <artifactId>tensorflow-core-platform-mkl</artifactId>
    <version>0.2.0</version>
</dependency>

Example of how to create Tensors from arrays with the new API:

float[] imgArray = new float[height * width* channel];
// .. assign img values to array
Shape shape = Shape.of(1, height, width, channel);
Tensor tensor = TFloat32.tensorOf(NdArrays.wrap(shape, DataBuffers.of(imgArray)));

Ping @tomburke-rse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant