小编Ame*_*eel的帖子

Firebase云功能更改超时

我在Android上使用Firebase Cloud Functions库,并使用getHttpsCallable调用云功能.

问题是函数需要10-15秒才能将结果返回给客户端,因此客户端会抛出异常java.net.SocketTimeoutException: timeout.

    // Create the arguments to the callable function.
    Map<String, Object> data = new HashMap<>();
    data.put("info", info);
    mFunctions.getHttpsCallable(function)
            .call(data)
            .continueWith(new Continuation<HttpsCallableResult, String>() {
                @Override
                public String then(@NonNull Task<HttpsCallableResult> task) {
                    // This continuation runs on either success or failure, but if the task
                    // has failed then getResult() will throw an Exception which will be
                    // propagated down.
                    if (task.isSuccessful()) {
                        String result = (String) task.getResult().getData();
                        Log.v(Constants.LOG_TAG, result);
                        return result;
                    } …
Run Code Online (Sandbox Code Playgroud)

java networking android firebase google-cloud-functions

9
推荐指数
1
解决办法
1499
查看次数

平方(x ^ 2)逼近的神经网络

我是TensorFlow和数据科学的新手。我做了一个简单的模块,应该弄清楚输入和输出数字之间的关系。在这种情况下,x和x平方。Python中的代码:

import numpy as np
import tensorflow as tf

# TensorFlow only log error messages.
tf.logging.set_verbosity(tf.logging.ERROR)

features = np.array([-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8,
                    9, 10], dtype = float)
labels = np.array([100, 81, 64, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 64,
                    81, 100], dtype = float)

model = tf.keras.Sequential([
    tf.keras.layers.Dense(units = 1, input_shape = [1])
])

model.compile(loss = …
Run Code Online (Sandbox Code Playgroud)

python machine-learning neural-network keras tensorflow

7
推荐指数
2
解决办法
453
查看次数

超过 Firebase Auth API 配额时会发生什么

我从Firebase Docs了解 Auth API 配额。我想知道超过这些配额后会发生什么?我会被收取更多费用吗?或者身份验证功能是否会停止,直到超过限制?

quota firebase firebase-authentication

5
推荐指数
1
解决办法
604
查看次数

Firebase CLI:指定了以下过滤器,但与项目中的任何功能都不匹配

我在我的项目中使用Firebase Cloud Functions,并且我有很多它们,因此当我运行常规时,firebase deploy我超出了配额,因此一种选择是仅部署通过使用此网页firebase deploy --only functions:function1中提到的方式修改的功能。此方法仅适用于以以下开头的函数:但是当我尝试将它与这样的函数一起使用时:exports.funcName

\n\n
function doesNotStartWithExports() {\n    // Does something.\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

它不起作用。我使用firebase deploy --only functions:doesNotStartWithExports但我得到这个输出:

\n\n
\xe2\x9a\xa0  functions: the following filters were specified but do not match any functions in the project: doesNotStartWithExports\n
Run Code Online (Sandbox Code Playgroud)\n\n

问题:如何部署不以导出开头的 Firebase 函数?

\n

firebase google-cloud-functions firebase-cli

4
推荐指数
1
解决办法
5701
查看次数