Skip to content

IllegalStateException: ERROR: Unable to run session Expects arg[0] to be uint8 but int32 is provided || Unsupported data type: UBYTE #980

Open
@CodeCombiner

Description

@CodeCombiner

Trying to run RunGraphExample frozen_graph.pb on trained model Faster-RCNN with Tensorflow 1.13.1 , org.deeplearning4j "1.0.0-beta6" (Tensorflow 1.15)

val data: Array[Array[Int]] = new Array[Array[Int]](img.getWidth * img.getHeight);
    for (i <- 0 until img.getWidth) {
      for (j <- 0 until img.getHeight()) {
        val ar: Array[Int] = new Array(3)
        ar(0) = color.getRed.byteValue() & 0xff
        ar(1) = color.getGreen.byteValue() & 0xff
        ar(2) = color.getBlue.byteValue() & 0xff
        data(i * img.getHeight + j) = ar
      }
    }
var arr: INDArray = Nd4j.createFromArray(data) 
//.castTo( org.nd4j.linalg.api.buffer.DataType.UBYTE)

Error appears at line inputMap.put(inputs.get(0), shapedArray)

if shapedArray is int then error is :

Unable to run session Expects arg[0] to be uint8 but int32 is provided

If shapedArray is short or .castTo(UBYTE) then error is :

Unsupported data type: UBYTE
or
Unsupported data type: SHORT

https://github.com/eclipse/deeplearning4j-examples/blob/master/tf-import-examples/src/main/java/org/nd4j/examples/RunGraphExample.java

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