在tensorflow 1.x中 我们可以通过
Example example = buildExample(attributeVector); byte[][] featureArray = new byte[1][]; featureArray[0] = example.toByteArray(); Tensor tensor = Tensor.create(featureArray);
在tf2.x java中删除了tensor.create()。 如何在java tf2.x中创建上述张量? 我试过这个:
Example example = buildExample(attributeVector); byte[][] featureArray = new byte[1][]; featureArray[0] = example.toByteArray(); LOGGER.info("feautre array: " + featureArray); Tensor tensor = TString.tensorOfBytes(NdArrays.scalarOfObject(featureArray));
错误是:
no instance(s) of type variable(s) exist so that byte[][] conforms to byte[] inference variable T has incompatible bounds: equality constraints: byte[] lower bounds: byte[][]
目前没有回答
相关问题 更多 >
编程相关推荐