每当我致电时FirebaseRemoteConfig.getInstance(),都会收到以下警告:
W/zze: Application name is not set. Call Builder#setApplicationName.
我已经从Firebase更新了json配置文件,但它保持不变。它不影响任何功能,但是我不禁认为缺少某些东西。我在某处可能缺少的任何配置?
我试图在我的Android应用程序上运行Tensorflow模型,但是与在桌面上运行Python时相比,相同的训练模型会产生不同的结果(错误的推断).
该模型是一个简单的连续CNN,用于识别字符,就像这个车牌识别网络一样,减去窗口,因为我的模型已经将字符裁剪到位.
我有:
我使用此代码将Keras模型保存为.pb文件.
Python代码,这可以按预期工作:
test_image = [ndimage.imread("test_image.png", mode="RGB").astype(float)/255]
imTensor = np.asarray(test_image)
def load_graph(model_file):
graph = tf.Graph()
graph_def = tf.GraphDef()
with open(model_file, "rb") as f:
graph_def.ParseFromString(f.read())
with graph.as_default():
tf.import_graph_def(graph_def)
return graph
graph=load_graph("model.pb")
with tf.Session(graph=graph) as sess:
input_operation = graph.get_operation_by_name("import/conv2d_1_input")
output_operation = graph.get_operation_by_name("import/output_node0")
results = sess.run(output_operation.outputs[0],
{input_operation.outputs[0]: imTensor})
Run Code Online (Sandbox Code Playgroud)
Android代码,基于此示例 ; 这给出了看似随机的结果:
Bitmap bitmap;
try {
InputStream stream = getAssets().open("test_image.png");
bitmap = BitmapFactory.decodeStream(stream);
} …Run Code Online (Sandbox Code Playgroud)