Skip to content

Upgrade to TensorFlow 2 #29

@frauzufall

Description

@frauzufall

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions