deeplearning4j / deeplearning4j/deeplearning4j-examples

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

Open
#980 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.5k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.