flowgraph java_TensorFlowInferenceInterface: Mobilenet for imagenet : java.io.IOException: Not a val...

2017-10-23 12:19:28

0

I am trying to run mobilenet model trained over imagenet on Android Tensorflow for object recognition and facing the issue as described below.

TensorFlowInferenceInterface: Failed to load model

from 'file:///android_asset/mobilenet_imagenet.pb': java.io.IOException:

Not a valid TensorFlow Graph serialization:

NodeDef mentions attr 'data_format' not in Op

signature=input:T, filter:T -> output:T;

attr=T:type,allowed=[DT_FLOAT, DT_DOUBLE]; attr=strides:list(int);

attr=padding:string,allowed=["SAME", "VALID"]>;

NodeDef: conv_dw_1/depthwise =

DepthwiseConv2dNative[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1]]

(conv1_relu/clip_by_value, conv_dw_1/depthwise_kernel/read)

I followed the tutorial as given in the link to integrate Tensorflow on Android. I could run basic CNN classifier custom trained (using python 2.7.12, Tensorflow 1.2 on Ubuntu 16.04)and it is working fine.

I could successfully run Mobilenet trained over imagenet on python 2.7.12 on Ubuntu 16.04 using Tensorflow 1.2 and 1.3. Now when I try to run the same '.pb' model on Android it gives me the error as mentioned above.

The code for initializing the model is as given below :

TensorFlowImageClassifier c = new TensorFlowImageClassifier();

c.inferenceInterface = new TensorFlowInferenceInterface();

if (c.inferenceInterface.initializeTensorFlow(assetManager, modelFilename) != 0) {

throw new RuntimeException("TF initialization failed");

}

Please provide me a solution or a work around

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值